| To: | xfs@xxxxxxxxxxx |
|---|---|
| Subject: | [PATCH 4/4] userns: eofblocks: convert project id from user to kernel space |
| From: | Gao feng <gaofeng@xxxxxxxxxxxxxx> |
| Date: | Wed, 4 Sep 2013 14:38:37 +0800 |
| Cc: | dwight.engen@xxxxxxxxxx, david@xxxxxxxxxxxxx, bfoster@xxxxxxxxxx, ebiederm@xxxxxxxxxxxx, Gao feng <gaofeng@xxxxxxxxxxxxxx> |
| Delivered-to: | xfs@xxxxxxxxxxx |
| In-reply-to: | <1378276717-9663-1-git-send-email-gaofeng@xxxxxxxxxxxxxx> |
| References: | <1378276717-9663-1-git-send-email-gaofeng@xxxxxxxxxxxxxx> |
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
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| ||
| Previous by Date: | [PATCH 2/4] userns: ioctl: convert project id between user and kernel space, Gao feng |
|---|---|
| Next by Date: | [PATCH 3/4] xfs: allow un-init user namespace to change file's project id, Gao feng |
| Previous by Thread: | [PATCH 2/4] userns: ioctl: convert project id between user and kernel space, Gao feng |
| Next by Thread: | [PATCH 3/4] xfs: allow un-init user namespace to change file's project id, Gao feng |
| Indexes: | [Date] [Thread] [Top] [All Lists] |