From 7d818a7b8fc8d26c24ee44ed1c5dece69455a7b6 Mon Sep 17 00:00:00 2001 From: "J. Bruce Fields" Date: Mon, 15 Aug 2011 16:59:55 -0400 Subject: 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 --- fs/nfsd/nfsfh.c | 9 --------- 1 file changed, 9 deletions(-) (limited to 'fs/nfsd/nfsfh.c') 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) static inline __be32 nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int type) { - /* Type can be negative when creating hardlinks - not to a dir */ if (type > 0 && (mode & S_IFMT) != type) { if (rqstp->rq_vers == 4 && (mode & S_IFMT) == S_IFLNK) return nfserr_symlink; @@ -72,14 +71,6 @@ nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int type) else return nfserr_inval; } - if (type < 0 && (mode & S_IFMT) == -type) { - if (rqstp->rq_vers == 4 && (mode & S_IFMT) == S_IFLNK) - return nfserr_symlink; - else if (type == -S_IFDIR) - return nfserr_isdir; - else - return nfserr_notdir; - } return 0; } -- cgit v1.2.3