aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-01 21:42:01 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-10-09 17:20:06 -0400
commitd75340cc4de5c187fbf0bba234309ca86cf0a2fb (patch)
treeaa53e3248bf3d61283f94187ffc83b18fa06bb7a /fs/nfs
parent216d5d06883edfaf992ada0d72a2a22fdfdbd296 (diff)
NFSv4: Fix nfs_atomic_open() to set the verifier on negative dentries too
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/dir.c8
-rw-r--r--fs/nfs/nfs4proc.c7
2 files changed, 6 insertions, 9 deletions
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index 41b063c98822..82878a19538d 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -656,11 +656,6 @@ static int nfs_check_verifier(struct inode *dir, struct dentry *dentry)
656 return 1; 656 return 1;
657} 657}
658 658
659static inline void nfs_set_verifier(struct dentry * dentry, unsigned long verf)
660{
661 dentry->d_time = verf;
662}
663
664/* 659/*
665 * Return the intent data that applies to this particular path component 660 * Return the intent data that applies to this particular path component
666 * 661 *
@@ -1016,7 +1011,6 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
1016 } 1011 }
1017 } else if (res != NULL) 1012 } else if (res != NULL)
1018 dentry = res; 1013 dentry = res;
1019 nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
1020out: 1014out:
1021 return res; 1015 return res;
1022no_open: 1016no_open:
@@ -1060,8 +1054,6 @@ static int nfs_open_revalidate(struct dentry *dentry, struct nameidata *nd)
1060 */ 1054 */
1061 lock_kernel(); 1055 lock_kernel();
1062 ret = nfs4_open_revalidate(dir, dentry, openflags, nd); 1056 ret = nfs4_open_revalidate(dir, dentry, openflags, nd);
1063 if (ret == 1)
1064 nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
1065 unlock_kernel(); 1057 unlock_kernel();
1066out: 1058out:
1067 dput(parent); 1059 dput(parent);
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 0748c700301d..52af5a7d679e 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -1399,13 +1399,16 @@ nfs4_atomic_open(struct inode *dir, struct dentry *dentry, struct nameidata *nd)
1399 state = nfs4_do_open(dir, &path, nd->intent.open.flags, &attr, cred); 1399 state = nfs4_do_open(dir, &path, nd->intent.open.flags, &attr, cred);
1400 put_rpccred(cred); 1400 put_rpccred(cred);
1401 if (IS_ERR(state)) { 1401 if (IS_ERR(state)) {
1402 if (PTR_ERR(state) == -ENOENT) 1402 if (PTR_ERR(state) == -ENOENT) {
1403 d_add(dentry, NULL); 1403 d_add(dentry, NULL);
1404 nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
1405 }
1404 return (struct dentry *)state; 1406 return (struct dentry *)state;
1405 } 1407 }
1406 res = d_add_unique(dentry, igrab(state->inode)); 1408 res = d_add_unique(dentry, igrab(state->inode));
1407 if (res != NULL) 1409 if (res != NULL)
1408 path.dentry = res; 1410 path.dentry = res;
1411 nfs_set_verifier(path.dentry, nfs_save_change_attribute(dir));
1409 nfs4_intent_set_file(nd, &path, state); 1412 nfs4_intent_set_file(nd, &path, state);
1410 return res; 1413 return res;
1411} 1414}
@@ -1439,6 +1442,7 @@ nfs4_open_revalidate(struct inode *dir, struct dentry *dentry, int openflags, st
1439 } 1442 }
1440 } 1443 }
1441 if (state->inode == dentry->d_inode) { 1444 if (state->inode == dentry->d_inode) {
1445 nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
1442 nfs4_intent_set_file(nd, &path, state); 1446 nfs4_intent_set_file(nd, &path, state);
1443 return 1; 1447 return 1;
1444 } 1448 }
@@ -1885,6 +1889,7 @@ nfs4_proc_create(struct inode *dir, struct dentry *dentry, struct iattr *sattr,
1885 goto out; 1889 goto out;
1886 } 1890 }
1887 d_add(dentry, igrab(state->inode)); 1891 d_add(dentry, igrab(state->inode));
1892 nfs_set_verifier(dentry, nfs_save_change_attribute(dir));
1888 if (flags & O_EXCL) { 1893 if (flags & O_EXCL) {
1889 struct nfs_fattr fattr; 1894 struct nfs_fattr fattr;
1890 status = nfs4_do_setattr(state->inode, &fattr, sattr, state); 1895 status = nfs4_do_setattr(state->inode, &fattr, sattr, state);