aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2016-07-05 09:44:53 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2016-07-05 16:02:23 -0400
commit00699ad8571afd7fb8bc2c61f67c86c2428680ab (patch)
tree60eef261c45881ff0985f2613047d9d58d20a857
parenta99cde438de0c4c0cecc1d1af1a55a75b10bfdef (diff)
Use the right predicate in ->atomic_open() instances
->atomic_open() can be given an in-lookup dentry *or* a negative one found in dcache. Use d_in_lookup() to tell one from another, rather than d_unhashed(). Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
-rw-r--r--fs/9p/vfs_inode.c2
-rw-r--r--fs/9p/vfs_inode_dotl.c2
-rw-r--r--fs/ceph/file.c2
-rw-r--r--fs/cifs/dir.c2
-rw-r--r--fs/fuse/dir.c2
-rw-r--r--fs/gfs2/inode.c2
-rw-r--r--fs/nfs/dir.c2
7 files changed, 7 insertions, 7 deletions
diff --git a/fs/9p/vfs_inode.c b/fs/9p/vfs_inode.c
index f4645c515262..e2e7c749925a 100644
--- a/fs/9p/vfs_inode.c
+++ b/fs/9p/vfs_inode.c
@@ -853,7 +853,7 @@ v9fs_vfs_atomic_open(struct inode *dir, struct dentry *dentry,
853 struct p9_fid *fid, *inode_fid; 853 struct p9_fid *fid, *inode_fid;
854 struct dentry *res = NULL; 854 struct dentry *res = NULL;
855 855
856 if (d_unhashed(dentry)) { 856 if (d_in_lookup(dentry)) {
857 res = v9fs_vfs_lookup(dir, dentry, 0); 857 res = v9fs_vfs_lookup(dir, dentry, 0);
858 if (IS_ERR(res)) 858 if (IS_ERR(res))
859 return PTR_ERR(res); 859 return PTR_ERR(res);
diff --git a/fs/9p/vfs_inode_dotl.c b/fs/9p/vfs_inode_dotl.c
index a34702c998f5..1b51eaa5e2dd 100644
--- a/fs/9p/vfs_inode_dotl.c
+++ b/fs/9p/vfs_inode_dotl.c
@@ -254,7 +254,7 @@ v9fs_vfs_atomic_open_dotl(struct inode *dir, struct dentry *dentry,
254 struct posix_acl *pacl = NULL, *dacl = NULL; 254 struct posix_acl *pacl = NULL, *dacl = NULL;
255 struct dentry *res = NULL; 255 struct dentry *res = NULL;
256 256
257 if (d_unhashed(dentry)) { 257 if (d_in_lookup(dentry)) {
258 res = v9fs_vfs_lookup(dir, dentry, 0); 258 res = v9fs_vfs_lookup(dir, dentry, 0);
259 if (IS_ERR(res)) 259 if (IS_ERR(res))
260 return PTR_ERR(res); 260 return PTR_ERR(res);
diff --git a/fs/ceph/file.c b/fs/ceph/file.c
index ce2f5795e44b..0daaf7ceedc5 100644
--- a/fs/ceph/file.c
+++ b/fs/ceph/file.c
@@ -394,7 +394,7 @@ int ceph_atomic_open(struct inode *dir, struct dentry *dentry,
394 if ((flags & O_CREAT) && !req->r_reply_info.head->is_dentry) 394 if ((flags & O_CREAT) && !req->r_reply_info.head->is_dentry)
395 err = ceph_handle_notrace_create(dir, dentry); 395 err = ceph_handle_notrace_create(dir, dentry);
396 396
397 if (d_unhashed(dentry)) { 397 if (d_in_lookup(dentry)) {
398 dn = ceph_finish_lookup(req, dentry, err); 398 dn = ceph_finish_lookup(req, dentry, err);
399 if (IS_ERR(dn)) 399 if (IS_ERR(dn))
400 err = PTR_ERR(dn); 400 err = PTR_ERR(dn);
diff --git a/fs/cifs/dir.c b/fs/cifs/dir.c
index c3eb998a99bd..fb0903fffc22 100644
--- a/fs/cifs/dir.c
+++ b/fs/cifs/dir.c
@@ -445,7 +445,7 @@ cifs_atomic_open(struct inode *inode, struct dentry *direntry,
445 * Check for hashed negative dentry. We have already revalidated 445 * Check for hashed negative dentry. We have already revalidated
446 * the dentry and it is fine. No need to perform another lookup. 446 * the dentry and it is fine. No need to perform another lookup.
447 */ 447 */
448 if (!d_unhashed(direntry)) 448 if (!d_in_lookup(direntry))
449 return -ENOENT; 449 return -ENOENT;
450 450
451 res = cifs_lookup(inode, direntry, 0); 451 res = cifs_lookup(inode, direntry, 0);
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index 264f07c7754e..cca7b048c07b 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -480,7 +480,7 @@ static int fuse_atomic_open(struct inode *dir, struct dentry *entry,
480 struct fuse_conn *fc = get_fuse_conn(dir); 480 struct fuse_conn *fc = get_fuse_conn(dir);
481 struct dentry *res = NULL; 481 struct dentry *res = NULL;
482 482
483 if (d_unhashed(entry)) { 483 if (d_in_lookup(entry)) {
484 res = fuse_lookup(dir, entry, 0); 484 res = fuse_lookup(dir, entry, 0);
485 if (IS_ERR(res)) 485 if (IS_ERR(res))
486 return PTR_ERR(res); 486 return PTR_ERR(res);
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c
index 21dc784f66c2..9bad79fede37 100644
--- a/fs/gfs2/inode.c
+++ b/fs/gfs2/inode.c
@@ -1189,7 +1189,7 @@ static int gfs2_atomic_open(struct inode *dir, struct dentry *dentry,
1189 struct dentry *d; 1189 struct dentry *d;
1190 bool excl = !!(flags & O_EXCL); 1190 bool excl = !!(flags & O_EXCL);
1191 1191
1192 if (!d_unhashed(dentry)) 1192 if (!d_in_lookup(dentry))
1193 goto skip_lookup; 1193 goto skip_lookup;
1194 1194
1195 d = __gfs2_lookup(dir, dentry, file, opened); 1195 d = __gfs2_lookup(dir, dentry, file, opened);
diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
index d8015a03db4c..3d5eb5edbf50 100644
--- a/fs/nfs/dir.c
+++ b/fs/nfs/dir.c
@@ -1504,7 +1504,7 @@ int nfs_atomic_open(struct inode *dir, struct dentry *dentry,
1504 1504
1505 /* NFS only supports OPEN on regular files */ 1505 /* NFS only supports OPEN on regular files */
1506 if ((open_flags & O_DIRECTORY)) { 1506 if ((open_flags & O_DIRECTORY)) {
1507 if (!d_unhashed(dentry)) { 1507 if (!d_in_lookup(dentry)) {
1508 /* 1508 /*
1509 * Hashed negative dentry with O_DIRECTORY: dentry was 1509 * Hashed negative dentry with O_DIRECTORY: dentry was
1510 * revalidated and is fine, no need to perform lookup 1510 * revalidated and is fine, no need to perform lookup