[PATCH 3/7] btrfs/acl: add noacl check for btrfs_get_acl()

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

 



btrfs returned the acl info though it was mounted with "noacl" option.

Steps to reproduce:
 # mkfs.btrfs /dev/sda2
 # mount /dev/sda2 /mnt
 # touch /mnt/file0
 # setfacl -m 'u:root:x,g::x,o::x' /mnt/file0
 # umount /mnt
 # mount /dev/sda2 -o noacl /mnt
 # getfacl /mnt/file0

we add a noacl check for btrfs_get_acl() to fix it.

Signed-off-by: Miao Xie <miaox@xxxxxxxxxxxxxx>
---
 fs/btrfs/acl.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/btrfs/acl.c b/fs/btrfs/acl.c
index bb35580..b070f58 100644
--- a/fs/btrfs/acl.c
+++ b/fs/btrfs/acl.c
@@ -37,6 +37,9 @@ static struct posix_acl *btrfs_get_acl(struct inode *inode, int type)
 	char *value = NULL;
 	struct posix_acl *acl;
 
+	if (!IS_POSIXACL(inode))
+		return NULL;
+
 	acl = get_cached_acl(inode, type);
 	if (acl != ACL_NOT_CACHED)
 		return acl;
-- 
1.7.0.1
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


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

  Powered by Linux