Loading fs/nfsd/nfsfh.c +18 −12 Original line number Diff line number Diff line Loading @@ -59,20 +59,26 @@ static int nfsd_acceptable(void *expv, struct dentry *dentry) * the write call). */ static inline __be32 nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int type) nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int requested) { if (type > 0 && (mode & S_IFMT) != type) { if (rqstp->rq_vers == 4 && (mode & S_IFMT) == S_IFLNK) mode &= S_IFMT; if (requested == 0) /* the caller doesn't care */ return nfs_ok; if (mode == requested) return nfs_ok; /* * v4 has an error more specific than err_notdir which we should * return in preference to err_notdir: */ if (rqstp->rq_vers == 4 && mode == S_IFLNK) return nfserr_symlink; else if (type == S_IFDIR) if (requested == S_IFDIR) return nfserr_notdir; else if ((mode & S_IFMT) == S_IFDIR) if (mode == S_IFDIR) return nfserr_isdir; else return nfserr_inval; } return 0; } static __be32 nfsd_setuser_and_check_port(struct svc_rqst *rqstp, struct svc_export *exp) Loading Loading
fs/nfsd/nfsfh.c +18 −12 Original line number Diff line number Diff line Loading @@ -59,20 +59,26 @@ static int nfsd_acceptable(void *expv, struct dentry *dentry) * the write call). */ static inline __be32 nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int type) nfsd_mode_check(struct svc_rqst *rqstp, umode_t mode, int requested) { if (type > 0 && (mode & S_IFMT) != type) { if (rqstp->rq_vers == 4 && (mode & S_IFMT) == S_IFLNK) mode &= S_IFMT; if (requested == 0) /* the caller doesn't care */ return nfs_ok; if (mode == requested) return nfs_ok; /* * v4 has an error more specific than err_notdir which we should * return in preference to err_notdir: */ if (rqstp->rq_vers == 4 && mode == S_IFLNK) return nfserr_symlink; else if (type == S_IFDIR) if (requested == S_IFDIR) return nfserr_notdir; else if ((mode & S_IFMT) == S_IFDIR) if (mode == S_IFDIR) return nfserr_isdir; else return nfserr_inval; } return 0; } static __be32 nfsd_setuser_and_check_port(struct svc_rqst *rqstp, struct svc_export *exp) Loading