[PATCH 4/4] userns: eofblocks: convert project id from user to kernel space

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Convert project id from user to kernel space in
xfs_fs_eofblocks_from_user.

Signed-off-by: Gao feng <gaofeng@xxxxxxxxxxxxxx>
---
 fs/xfs/xfs_icache.h | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/fs/xfs/xfs_icache.h b/fs/xfs/xfs_icache.h
index 8a89f7d..aeedfc8 100644
--- a/fs/xfs/xfs_icache.h
+++ b/fs/xfs/xfs_icache.h
@@ -80,7 +80,6 @@ xfs_fs_eofblocks_from_user(
 		return EINVAL;
 
 	dst->eof_flags = src->eof_flags;
-	dst->eof_prid = src->eof_prid;
 	dst->eof_min_file_size = src->eof_min_file_size;
 
 	dst->eof_uid = INVALID_UID;
@@ -96,6 +95,14 @@ xfs_fs_eofblocks_from_user(
 		if (!gid_valid(dst->eof_gid))
 			return EINVAL;
 	}
+
+	dst->eof_prid = src->eof_prid;
+	if (src->eof_flags & XFS_EOF_FLAGS_PRID) {
+		if (xfs_convert_to_kernel_projid(src->eof_prid,
+						 &dst->eof_prid) < 0)
+			return EINVAL;
+	}
+
 	return 0;
 }
 
-- 
1.8.3.1

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs




[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux