diff options
author | J. Bruce Fields <bfields@redhat.com> | 2016-07-19 17:33:04 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2016-08-04 17:11:48 -0400 |
commit | e75b23f9e323b1e0759619c39d5a9f7a3a5d9d2c (patch) | |
tree | f87cc0dee5dbb4f22fda8ab3c92dba6e83b75a29 /fs/nfsd/vfs.c | |
parent | 12391d07230ec7368269227207b961b2dcb34180 (diff) | |
download | linux-e75b23f9e323b1e0759619c39d5a9f7a3a5d9d2c.tar.gz linux-e75b23f9e323b1e0759619c39d5a9f7a3a5d9d2c.tar.bz2 linux-e75b23f9e323b1e0759619c39d5a9f7a3a5d9d2c.zip |
nfsd: check d_can_lookup in fh_verify of directories
Create and other nfsd ops generally assume we can call lookup_one_len on
inodes with S_IFDIR set. Al says that this assumption isn't true in
general, though it should be for the filesystem objects nfsd sees.
Add a check just to make sure our assumption isn't violated.
Remove a couple checks for i_op->lookup in create code.
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r-- | fs/nfsd/vfs.c | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index fba8e7e521e0..cf14e394a1b0 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c @@ -1169,9 +1169,6 @@ nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, dentry = fhp->fh_dentry; dirp = d_inode(dentry); - err = nfserr_notdir; - if (!dirp->i_op->lookup) - goto out; /* * Check whether the response file handle has been verified yet. * If it has, the parent directory should already be locked. @@ -1310,12 +1307,6 @@ do_nfsd_create(struct svc_rqst *rqstp, struct svc_fh *fhp, dentry = fhp->fh_dentry; dirp = d_inode(dentry); - /* Get all the sanity checks out of the way before - * we lock the parent. */ - err = nfserr_notdir; - if (!dirp->i_op->lookup) - goto out; - host_err = fh_want_write(fhp); if (host_err) goto out_nfserr; |