diff options
author | Tiger Yang <tiger.yang@oracle.com> | 2008-11-13 22:17:52 -0500 |
---|---|---|
committer | Mark Fasheh <mfasheh@suse.com> | 2009-01-05 11:36:52 -0500 |
commit | a68979b857283daf4acc405e476dcc8812a3ff2b (patch) | |
tree | 6bbf9d235e1ae38f4263f92d4075df6913befc8a | |
parent | 89c38bd0ade3c567707ed8fce088b253b0369c50 (diff) |
ocfs2: add mount option and Kconfig option for acl
This patch adds the Kconfig option "CONFIG_OCFS2_FS_POSIX_ACL"
and mount options "acl" to enable acls in Ocfs2.
Signed-off-by: Tiger Yang <tiger.yang@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
-rw-r--r-- | Documentation/filesystems/ocfs2.txt | 3 | ||||
-rw-r--r-- | fs/Kconfig | 9 | ||||
-rw-r--r-- | fs/ocfs2/super.c | 33 |
3 files changed, 44 insertions, 1 deletions
diff --git a/Documentation/filesystems/ocfs2.txt b/Documentation/filesystems/ocfs2.txt index 67310fbbb7df..c2a0871280a0 100644 --- a/Documentation/filesystems/ocfs2.txt +++ b/Documentation/filesystems/ocfs2.txt | |||
@@ -31,7 +31,6 @@ Features which OCFS2 does not support yet: | |||
31 | - quotas | 31 | - quotas |
32 | - Directory change notification (F_NOTIFY) | 32 | - Directory change notification (F_NOTIFY) |
33 | - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease) | 33 | - Distributed Caching (F_SETLEASE/F_GETLEASE/break_lease) |
34 | - POSIX ACLs | ||
35 | 34 | ||
36 | Mount options | 35 | Mount options |
37 | ============= | 36 | ============= |
@@ -79,3 +78,5 @@ inode64 Indicates that Ocfs2 is allowed to create inodes at | |||
79 | bits of significance. | 78 | bits of significance. |
80 | user_xattr (*) Enables Extended User Attributes. | 79 | user_xattr (*) Enables Extended User Attributes. |
81 | nouser_xattr Disables Extended User Attributes. | 80 | nouser_xattr Disables Extended User Attributes. |
81 | acl Enables POSIX Access Control Lists support. | ||
82 | noacl (*) Disables POSIX Access Control Lists support. | ||
diff --git a/fs/Kconfig b/fs/Kconfig index ff0e81980207..e8a47f74a839 100644 --- a/fs/Kconfig +++ b/fs/Kconfig | |||
@@ -268,6 +268,15 @@ config OCFS2_COMPAT_JBD | |||
268 | is backwards compatible with JBD. It is safe to say N here. | 268 | is backwards compatible with JBD. It is safe to say N here. |
269 | However, if you really want to use the original JBD, say Y here. | 269 | However, if you really want to use the original JBD, say Y here. |
270 | 270 | ||
271 | config OCFS2_FS_POSIX_ACL | ||
272 | bool "OCFS2 POSIX Access Control Lists" | ||
273 | depends on OCFS2_FS | ||
274 | select FS_POSIX_ACL | ||
275 | default n | ||
276 | help | ||
277 | Posix Access Control Lists (ACLs) support permissions for users and | ||
278 | groups beyond the owner/group/world scheme. | ||
279 | |||
271 | endif # BLOCK | 280 | endif # BLOCK |
272 | 281 | ||
273 | source "fs/notify/Kconfig" | 282 | source "fs/notify/Kconfig" |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 304b63ac78cf..9e7accc68b4b 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -158,6 +158,8 @@ enum { | |||
158 | Opt_user_xattr, | 158 | Opt_user_xattr, |
159 | Opt_nouser_xattr, | 159 | Opt_nouser_xattr, |
160 | Opt_inode64, | 160 | Opt_inode64, |
161 | Opt_acl, | ||
162 | Opt_noacl, | ||
161 | Opt_err, | 163 | Opt_err, |
162 | }; | 164 | }; |
163 | 165 | ||
@@ -180,6 +182,8 @@ static const match_table_t tokens = { | |||
180 | {Opt_user_xattr, "user_xattr"}, | 182 | {Opt_user_xattr, "user_xattr"}, |
181 | {Opt_nouser_xattr, "nouser_xattr"}, | 183 | {Opt_nouser_xattr, "nouser_xattr"}, |
182 | {Opt_inode64, "inode64"}, | 184 | {Opt_inode64, "inode64"}, |
185 | {Opt_acl, "acl"}, | ||
186 | {Opt_noacl, "noacl"}, | ||
183 | {Opt_err, NULL} | 187 | {Opt_err, NULL} |
184 | }; | 188 | }; |
185 | 189 | ||
@@ -466,6 +470,8 @@ unlock_osb: | |||
466 | if (!ret) { | 470 | if (!ret) { |
467 | /* Only save off the new mount options in case of a successful | 471 | /* Only save off the new mount options in case of a successful |
468 | * remount. */ | 472 | * remount. */ |
473 | if (!(osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_XATTR)) | ||
474 | parsed_options.mount_opt &= ~OCFS2_MOUNT_POSIX_ACL; | ||
469 | osb->s_mount_opt = parsed_options.mount_opt; | 475 | osb->s_mount_opt = parsed_options.mount_opt; |
470 | osb->s_atime_quantum = parsed_options.atime_quantum; | 476 | osb->s_atime_quantum = parsed_options.atime_quantum; |
471 | osb->preferred_slot = parsed_options.slot; | 477 | osb->preferred_slot = parsed_options.slot; |
@@ -651,6 +657,10 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
651 | } | 657 | } |
652 | brelse(bh); | 658 | brelse(bh); |
653 | bh = NULL; | 659 | bh = NULL; |
660 | |||
661 | if (!(osb->s_feature_incompat & OCFS2_FEATURE_INCOMPAT_XATTR)) | ||
662 | parsed_options.mount_opt &= ~OCFS2_MOUNT_POSIX_ACL; | ||
663 | |||
654 | osb->s_mount_opt = parsed_options.mount_opt; | 664 | osb->s_mount_opt = parsed_options.mount_opt; |
655 | osb->s_atime_quantum = parsed_options.atime_quantum; | 665 | osb->s_atime_quantum = parsed_options.atime_quantum; |
656 | osb->preferred_slot = parsed_options.slot; | 666 | osb->preferred_slot = parsed_options.slot; |
@@ -664,6 +674,9 @@ static int ocfs2_fill_super(struct super_block *sb, void *data, int silent) | |||
664 | 674 | ||
665 | sb->s_magic = OCFS2_SUPER_MAGIC; | 675 | sb->s_magic = OCFS2_SUPER_MAGIC; |
666 | 676 | ||
677 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | | ||
678 | ((osb->s_mount_opt & OCFS2_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0); | ||
679 | |||
667 | /* Hard readonly mode only if: bdev_read_only, MS_RDONLY, | 680 | /* Hard readonly mode only if: bdev_read_only, MS_RDONLY, |
668 | * heartbeat=none */ | 681 | * heartbeat=none */ |
669 | if (bdev_read_only(sb->s_bdev)) { | 682 | if (bdev_read_only(sb->s_bdev)) { |
@@ -945,6 +958,19 @@ static int ocfs2_parse_options(struct super_block *sb, | |||
945 | case Opt_inode64: | 958 | case Opt_inode64: |
946 | mopt->mount_opt |= OCFS2_MOUNT_INODE64; | 959 | mopt->mount_opt |= OCFS2_MOUNT_INODE64; |
947 | break; | 960 | break; |
961 | #ifdef CONFIG_OCFS2_FS_POSIX_ACL | ||
962 | case Opt_acl: | ||
963 | mopt->mount_opt |= OCFS2_MOUNT_POSIX_ACL; | ||
964 | break; | ||
965 | case Opt_noacl: | ||
966 | mopt->mount_opt &= ~OCFS2_MOUNT_POSIX_ACL; | ||
967 | break; | ||
968 | #else | ||
969 | case Opt_acl: | ||
970 | case Opt_noacl: | ||
971 | printk(KERN_INFO "ocfs2 (no)acl options not supported\n"); | ||
972 | break; | ||
973 | #endif | ||
948 | default: | 974 | default: |
949 | mlog(ML_ERROR, | 975 | mlog(ML_ERROR, |
950 | "Unrecognized mount option \"%s\" " | 976 | "Unrecognized mount option \"%s\" " |
@@ -1017,6 +1043,13 @@ static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt) | |||
1017 | if (opts & OCFS2_MOUNT_INODE64) | 1043 | if (opts & OCFS2_MOUNT_INODE64) |
1018 | seq_printf(s, ",inode64"); | 1044 | seq_printf(s, ",inode64"); |
1019 | 1045 | ||
1046 | #ifdef CONFIG_OCFS2_FS_POSIX_ACL | ||
1047 | if (opts & OCFS2_MOUNT_POSIX_ACL) | ||
1048 | seq_printf(s, ",acl"); | ||
1049 | else | ||
1050 | seq_printf(s, ",noacl"); | ||
1051 | #endif | ||
1052 | |||
1020 | return 0; | 1053 | return 0; |
1021 | } | 1054 | } |
1022 | 1055 | ||