aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd/nfsfh.c
diff options
context:
space:
mode:
authorJ. Bruce Fields <bfields@redhat.com>2011-08-15 16:59:55 -0400
committerJ. Bruce Fields <bfields@redhat.com>2011-08-26 18:22:47 -0400
commit7d818a7b8fc8d26c24ee44ed1c5dece69455a7b6 (patch)
tree660675f24b5dcb74630defb9a576d1cba6fb36a8 /fs/nfsd/nfsfh.c
parent3d2544b1e4909b6dffa0d140273628913e255e45 (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/nfsfh.c')
-rw-r--r--fs/nfsd/nfsfh.c9
1 files changed, 0 insertions, 9 deletions
diff --git a/fs/nfsd/nfsfh.c b/fs/nfsd/nfsfh.c
index 90c6aa6d5e0f..8cd49b9bf085 100644
--- a/fs/nfsd/nfsfh.c
+++ b/fs/nfsd/nfsfh.c
@@ -61,7 +61,6 @@ static int nfsd_acceptable(void *expv, struct dentry *dentry)
61static inline __be32 61static inline __be32
62nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int type) 62nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int type)
63{ 63{
64 /* Type can be negative when creating hardlinks - not to a dir */
65 if (type > 0 && (mode & S_IFMT) != type) { 64 if (type > 0 && (mode & S_IFMT) != type) {
66 if (rqstp->rq_vers == 4 && (mode & S_IFMT) == S_IFLNK) 65 if (rqstp->rq_vers == 4 && (mode & S_IFMT) == S_IFLNK)
67 return nfserr_symlink; 66 return nfserr_symlink;
@@ -72,14 +71,6 @@ nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int type)
72 else 71 else
73 return nfserr_inval; 72 return nfserr_inval;
74 } 73 }
75 if (type < 0 && (mode & S_IFMT) == -type) {
76 if (rqstp->rq_vers == 4 && (mode & S_IFMT) == S_IFLNK)
77 return nfserr_symlink;
78 else if (type == -S_IFDIR)
79 return nfserr_isdir;
80 else
81 return nfserr_notdir;
82 }
83 return 0; 74 return 0;
84} 75}
85 76