* [PATCH] btrfs: prohibit a operation of changing acl's mask when noacl mount option used
@ 2010-05-18 0:51 Shi Weihua
0 siblings, 0 replies; only message in thread
From: Shi Weihua @ 2010-05-18 0:51 UTC (permalink / raw)
To: chris.mason, Yan, Zheng; +Cc: linux-btrfs, LKML
when used Posix File System Test Suite(pjd-fstest) to test btrfs,
some cases about setfacl failed when noacl mount option used.
I simplified used commands in pjd-fstest, and the following steps
can reproduce it.
------------------------
# cd btrfs-part/
# mkdir aaa
# setfacl -m m::rw aaa <- successed, but not expected by pjd-fstest.
------------------------
I checked ext3, a warning message occured, like as:
setfacl: aaa/: Operation not supported
Certainly, it's expected by pjd-fstest.
So, i compared acl.c of btrfs and ext3. Based on that, a patch created.
Fortunately, it works.
Signed-off-by: Shi Weihua <shiwh@cn.fujitsu.com>
---
diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index da3133c..f2e09c2 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -159,6 +159,9 @@ static int btrfs_xattr_set_acl(struct inode *inode, int type,
int ret;
struct posix_acl *acl = NULL;
+ if (!IS_POSIXACL(inode))
+ return -EOPNOTSUPP;
+
if (value) {
acl = posix_acl_from_xattr(value, size);
if (acl == NULL) {
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2010-05-18 0:51 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-18 0:51 [PATCH] btrfs: prohibit a operation of changing acl's mask when noacl mount option used Shi Weihua
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).