aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfsd
diff options
context:
space:
mode:
authorKinglong Mee <kinglongmee@gmail.com>2015-07-30 09:51:54 -0400
committerJ. Bruce Fields <bfields@redhat.com>2015-08-31 15:11:05 -0400
commit0a2050d744037158de773be5c6f1fc468a551bae (patch)
treeddc37926efa9b50706b2e7fad3e5ef7b2e4dae88 /fs/nfsd
parente538674740e632b57091f72cc06c0b03b45fb021 (diff)
NFSD: Store parent's stat in a separate value
After commit ae7095a7c4 (nfsd4: helper function for getting mounted_on ino) we ignore the return value from get_parent_attributes(). Also, the following FATTR4_WORD2_LAYOUT_BLKSIZE uses stat.blksize, so to avoid overwriting that, use an independent value for the parent's attributes. Signed-off-by: Kinglong Mee <kinglongmee@gmail.com> Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Diffstat (limited to 'fs/nfsd')
-rw-r--r--fs/nfsd/nfs4xdr.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 75e0563c09d1..1aa0dc38ed58 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2675,6 +2675,9 @@ out_acl:
2675 *p++ = cpu_to_be32(stat.mtime.tv_nsec); 2675 *p++ = cpu_to_be32(stat.mtime.tv_nsec);
2676 } 2676 }
2677 if (bmval1 & FATTR4_WORD1_MOUNTED_ON_FILEID) { 2677 if (bmval1 & FATTR4_WORD1_MOUNTED_ON_FILEID) {
2678 struct kstat parent_stat;
2679 u64 ino = stat.ino;
2680
2678 p = xdr_reserve_space(xdr, 8); 2681 p = xdr_reserve_space(xdr, 8);
2679 if (!p) 2682 if (!p)
2680 goto out_resource; 2683 goto out_resource;
@@ -2683,9 +2686,13 @@ out_acl:
2683 * and this is the root of a cross-mounted filesystem. 2686 * and this is the root of a cross-mounted filesystem.
2684 */ 2687 */
2685 if (ignore_crossmnt == 0 && 2688 if (ignore_crossmnt == 0 &&
2686 dentry == exp->ex_path.mnt->mnt_root) 2689 dentry == exp->ex_path.mnt->mnt_root) {
2687 get_parent_attributes(exp, &stat); 2690 err = get_parent_attributes(exp, &parent_stat);
2688 p = xdr_encode_hyper(p, stat.ino); 2691 if (err)
2692 goto out_nfserr;
2693 ino = parent_stat.ino;
2694 }
2695 p = xdr_encode_hyper(p, ino);
2689 } 2696 }
2690#ifdef CONFIG_NFSD_PNFS 2697#ifdef CONFIG_NFSD_PNFS
2691 if ((bmval1 & FATTR4_WORD1_FS_LAYOUT_TYPES) || 2698 if ((bmval1 & FATTR4_WORD1_FS_LAYOUT_TYPES) ||