All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] f2fs: Check the acl's validity before setting
       [not found] <1396429285-64601-1-git-send-email-zhenzhang.zhang@huawei.com>
@ 2014-04-04  1:47 ` ZhangZhen
  0 siblings, 0 replies; only message in thread
From: ZhangZhen @ 2014-04-04  1:47 UTC (permalink / raw)
  To: jaegeuk.kim; +Cc: linux-f2fs-devel


Before setting the acl, call posix_acl_valid() to check if it is
valid or not.

Signed-off-by: zhangzhen <zhenzhang.zhang@huawei.com>
---
 fs/f2fs/acl.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/fs/f2fs/acl.c b/fs/f2fs/acl.c
index fa8da4c..d4069e1 100644
--- a/fs/f2fs/acl.c
+++ b/fs/f2fs/acl.c
@@ -203,6 +203,12 @@ static int __f2fs_set_acl(struct inode *inode, int type,
 	size_t size = 0;
 	int error;

+	if (acl) {
+		error = posix_acl_valid(acl);
+		if (error < 0)
+			return error;
+	}
+
 	switch (type) {
 	case ACL_TYPE_ACCESS:
 		name_index = F2FS_XATTR_INDEX_POSIX_ACL_ACCESS;
-- 
1.6.0.2


.





------------------------------------------------------------------------------

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2014-04-04  1:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1396429285-64601-1-git-send-email-zhenzhang.zhang@huawei.com>
2014-04-04  1:47 ` [PATCH] f2fs: Check the acl's validity before setting ZhangZhen

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.