Skip to contentSkip to conversation

f2fs: Check the acl's validity before setting

PATCH New ZhangZhen 1 participant 1 message Apr 4, 2014 1 message not in the archive F2FS file system

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

ZhangZhen

author
#1 lore raw

PATCH 1/1 f2fs: Check the acl's validity before setting

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

---
 fs/f2fs/acl.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
fs/f2fs/acl.c +6 -0
index fa8da4c..d4069e1 100644
@@ -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;
Signature · 10 lines
1.6.0.2


.





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