Skip to contentSkip to conversation

ocfs2: Prevent mount with "-o acl" if acl isn't supported.

PATCH New Tao Ma 2 participants 4 messages Jun 10, 2009 – Jun 12, 2009 OCFS2

lore
Share & tools
lore

Tao Ma

author
#0 lore raw

PATCH 1/1 ocfs2: Prevent mount with "-o acl" if acl isn't supported.

Currently, if we don't enable CONFIG_OCFS2_FS_POSIX_ACL, ocfs2 will not support acl. That is OK.

But in the following case:
1. kernel isn't built to support acl.
2. mount -t ocfs2 -o acl /dev/sdx /mnt/ocfs2.
It sucesses. And what's more, if I do "mount|grep sdx" will get /dev/sdx on /mnt/ocfs2 type ocfs2 (rw,acl,heartbeat=none)

So a normal user will just think acl now is ok for the volume and he will surely be puzzled when he tries setfacl and fails with "Operation not supported".

The good thing is that the kernel already printk some useful information, so this patch just tries to prevent the user from mounting the volume.

Cc Tiger Yang <[email protected]>
---
 fs/ocfs2/super.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
fs/ocfs2/super.c +2 -1
index 035af49..f570a24 100644
@@ -1206,7 +1206,8 @@ static int ocfs2_parse_options(struct super_block *sb,
 		case Opt_acl:
 		case Opt_noacl:
 			printk(KERN_INFO "ocfs2 (no)acl options not supported\n");
-			break;
+			status = 0;
+			goto bail;
 #endif
 		default:
 			mlog(ML_ERROR,
Signature · 1 line
1.5.5
#1 lore raw

PATCH 1/1 ocfs2: Prevent mount with "-o acl" if acl isn't supported.

Quoted 9 lines · Tao Ma

Currently, if we don't enable CONFIG_OCFS2_FS_POSIX_ACL, ocfs2 will not support acl. That is OK.

But in the following case:
1. kernel isn't built to support acl.
2. mount -t ocfs2 -o acl /dev/sdx /mnt/ocfs2.
It sucesses. And what's more, if I do "mount|grep sdx" will get /dev/sdx on /mnt/ocfs2 type ocfs2 (rw,acl,heartbeat=none)

Quoted 7 lines

So a normal user will just think acl now is ok for the volume and he will surely be puzzled when he tries setfacl and fails with "Operation not supported".

The good thing is that the kernel already printk some useful information, so this patch just tries to prevent the user from mounting the volume.

Hmm, everyone else seems to do it the way we have been. Trying
to think about the surprise you describe vs the surprise of ocfs2 being different than other linux filesystms.

Joel

Signature · 9 lines
"Here's something to think about:  How come you never see a headline
 like ``Psychic Wins Lottery''?"
	- Jay Leno

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
#2 lore raw

PATCH 1/1 ocfs2: Prevent mount with "-o acl" if acl isn't supported.

Quoted 14 lines · Joel Becker
Quoted 13 lines · Tao Ma

Currently, if we don't enable CONFIG_OCFS2_FS_POSIX_ACL, ocfs2 will not support acl. That is OK.

But in the following case:
1. kernel isn't built to support acl.
2. mount -t ocfs2 -o acl /dev/sdx /mnt/ocfs2.
It sucesses. And what's more, if I do "mount|grep sdx" will get /dev/sdx on /mnt/ocfs2 type ocfs2 (rw,acl,heartbeat=none)

So a normal user will just think acl now is ok for the volume and he will surely be puzzled when he tries setfacl and fails with "Operation not supported".

Quoted 7 lines
Quoted 3 lines

The good thing is that the kernel already printk some useful information, so this patch just tries to prevent the user from mounting the volume.

Hmm, everyone else seems to do it the way we have been. Trying
to think about the surprise you describe vs the surprise of ocfs2 being different than other linux filesystms.

Ok, I bounced this off of various fs developers, and there was
significant support for leaving it as-is. Basically, it would suck for every filesystem in fstab to fail to mount just because you changed your kernel.
Chris and Cristoph pointed out that btrfs and xfs always assume
'-o acl,user_xattr' if the feature is compiled in. They are always on. btrfs only disables acls with '-o noacl'. Might be worth considering.

Joel

Signature · 9 lines
"I am working for the time when unqualified blacks, browns, and
 women join the unqualified men in running our overnment."
	- Sissy Farenthold

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127
author
#3 lore raw

PATCH 1/1 ocfs2: Prevent mount with "-o acl" if acl isn't supported.

Quoted 18 lines · Joel Becker
Quoted 17 lines · Joel Becker
Quoted 16 lines · Tao Ma

Currently, if we don't enable CONFIG_OCFS2_FS_POSIX_ACL, ocfs2 will not support acl. That is OK.

But in the following case:
1. kernel isn't built to support acl.
2. mount -t ocfs2 -o acl /dev/sdx /mnt/ocfs2.
It sucesses. And what's more, if I do "mount|grep sdx" will get /dev/sdx on /mnt/ocfs2 type ocfs2 (rw,acl,heartbeat=none)

So a normal user will just think acl now is ok for the volume and he will surely be puzzled when he tries setfacl and fails with "Operation not supported".

The good thing is that the kernel already printk some useful information, so this patch just tries to prevent the user from mounting the volume.

Quoted 8 lines
Quoted 3 lines

Hmm, everyone else seems to do it the way we have been. Trying
to think about the surprise you describe vs the surprise of ocfs2 being different than other linux filesystms.

Ok, I bounced this off of various fs developers, and there was
significant support for leaving it as-is. Basically, it would suck for every filesystem in fstab to fail to mount just because you changed your kernel.

OK, fair enough. Thank.

Regards,
Tao