diff options
author | J. Bruce Fields <bfields@redhat.com> | 2011-08-15 16:59:55 -0400 |
---|---|---|
committer | J. Bruce Fields <bfields@redhat.com> | 2011-08-26 18:22:47 -0400 |
commit | 7d818a7b8fc8d26c24ee44ed1c5dece69455a7b6 (patch) | |
tree | 660675f24b5dcb74630defb9a576d1cba6fb36a8 /fs/nfsd/vfs.c | |
parent | 3d2544b1e4909b6dffa0d140273628913e255e45 (diff) |
nfsd: open-code special directory-hardlink check
We allow the fh_verify caller to specify that any object *except* those
of a given type is allowed, by passing a negative type. But only one
caller actually uses it. Open-code that check in the one caller.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd/vfs.c')
-rw-r--r-- | fs/nfsd/vfs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c index fd0acca5370a..0c92a17d1770 100644 --- a/fs/nfsd/vfs.c +++ b/fs/nfsd/vfs.c | |||
@@ -1632,10 +1632,12 @@ nfsd_link(struct svc_rqst *rqstp, struct svc_fh *ffhp, | |||
1632 | err = fh_verify(rqstp, ffhp, S_IFDIR, NFSD_MAY_CREATE); | 1632 | err = fh_verify(rqstp, ffhp, S_IFDIR, NFSD_MAY_CREATE); |
1633 | if (err) | 1633 | if (err) |
1634 | goto out; | 1634 | goto out; |
1635 | err = fh_verify(rqstp, tfhp, -S_IFDIR, NFSD_MAY_NOP); | 1635 | err = fh_verify(rqstp, tfhp, 0, NFSD_MAY_NOP); |
1636 | if (err) | 1636 | if (err) |
1637 | goto out; | 1637 | goto out; |
1638 | 1638 | err = nfserr_isdir; | |
1639 | if (S_ISDIR(tfhp->fh_dentry->d_inode->i_mode)) | ||
1640 | goto out; | ||
1639 | err = nfserr_perm; | 1641 | err = nfserr_perm; |
1640 | if (!len) | 1642 | if (!len) |
1641 | goto out; | 1643 | goto out; |