Skip to content

Commit

Permalink
ocfs2: Always include ACL support
Browse files Browse the repository at this point in the history
To become consistent with filesystems such as XFS or BTRFS, make posix
ACLs always available. This also reduces possibility of
misconfiguration on admin's side.

Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
  • Loading branch information
Jan Kara authored and Joel Becker committed Oct 29, 2009
1 parent 2f48d59 commit e6aabe0
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 51 deletions.
10 changes: 1 addition & 9 deletions fs/ocfs2/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ config OCFS2_FS
select CRC32
select QUOTA
select QUOTA_TREE
select FS_POSIX_ACL
help
OCFS2 is a general purpose extent based shared disk cluster file
system with many similarities to ext3. It supports 64 bit inode
Expand Down Expand Up @@ -74,12 +75,3 @@ config OCFS2_DEBUG_FS
This option will enable expensive consistency checks. Enable
this option for debugging only as it is likely to decrease
performance of the filesystem.

config OCFS2_FS_POSIX_ACL
bool "OCFS2 POSIX Access Control Lists"
depends on OCFS2_FS
select FS_POSIX_ACL
default n
help
Posix Access Control Lists (ACLs) support permissions for users and
groups beyond the owner/group/world scheme.
7 changes: 2 additions & 5 deletions fs/ocfs2/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,8 @@ ocfs2-objs := \
ver.o \
quota_local.o \
quota_global.o \
xattr.o

ifeq ($(CONFIG_OCFS2_FS_POSIX_ACL),y)
ocfs2-objs += acl.o
endif
xattr.o \
acl.o

ocfs2_stackglue-objs := stackglue.o
ocfs2_stack_o2cb-objs := stack_o2cb.o
Expand Down
22 changes: 0 additions & 22 deletions fs/ocfs2/acl.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,11 @@ struct ocfs2_acl_entry {
__le32 e_id;
};

#ifdef CONFIG_OCFS2_FS_POSIX_ACL

extern int ocfs2_check_acl(struct inode *, int);
extern int ocfs2_acl_chmod(struct inode *);
extern int ocfs2_init_acl(handle_t *, struct inode *, struct inode *,
struct buffer_head *, struct buffer_head *,
struct ocfs2_alloc_context *,
struct ocfs2_alloc_context *);

#else /* CONFIG_OCFS2_FS_POSIX_ACL*/

#define ocfs2_check_acl NULL
static inline int ocfs2_acl_chmod(struct inode *inode)
{
return 0;
}
static inline int ocfs2_init_acl(handle_t *handle,
struct inode *inode,
struct inode *dir,
struct buffer_head *di_bh,
struct buffer_head *dir_bh,
struct ocfs2_alloc_context *meta_ac,
struct ocfs2_alloc_context *data_ac)
{
return 0;
}

#endif /* CONFIG_OCFS2_FS_POSIX_ACL*/

#endif /* OCFS2_ACL_H */
9 changes: 0 additions & 9 deletions fs/ocfs2/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -1413,19 +1413,12 @@ static int ocfs2_parse_options(struct super_block *sb,
}
mopt->mount_opt |= OCFS2_MOUNT_GRPQUOTA;
break;
#ifdef CONFIG_OCFS2_FS_POSIX_ACL
case Opt_acl:
mopt->mount_opt |= OCFS2_MOUNT_POSIX_ACL;
break;
case Opt_noacl:
mopt->mount_opt &= ~OCFS2_MOUNT_POSIX_ACL;
break;
#else
case Opt_acl:
case Opt_noacl:
printk(KERN_INFO "ocfs2 (no)acl options not supported\n");
break;
#endif
default:
mlog(ML_ERROR,
"Unrecognized mount option \"%s\" "
Expand Down Expand Up @@ -1502,12 +1495,10 @@ static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt)
if (opts & OCFS2_MOUNT_INODE64)
seq_printf(s, ",inode64");

#ifdef CONFIG_OCFS2_FS_POSIX_ACL
if (opts & OCFS2_MOUNT_POSIX_ACL)
seq_printf(s, ",acl");
else
seq_printf(s, ",noacl");
#endif

return 0;
}
Expand Down
4 changes: 0 additions & 4 deletions fs/ocfs2/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,23 +98,19 @@ static struct ocfs2_xattr_def_value_root def_xv = {

struct xattr_handler *ocfs2_xattr_handlers[] = {
&ocfs2_xattr_user_handler,
#ifdef CONFIG_OCFS2_FS_POSIX_ACL
&ocfs2_xattr_acl_access_handler,
&ocfs2_xattr_acl_default_handler,
#endif
&ocfs2_xattr_trusted_handler,
&ocfs2_xattr_security_handler,
NULL
};

static struct xattr_handler *ocfs2_xattr_handler_map[OCFS2_XATTR_MAX] = {
[OCFS2_XATTR_INDEX_USER] = &ocfs2_xattr_user_handler,
#ifdef CONFIG_OCFS2_FS_POSIX_ACL
[OCFS2_XATTR_INDEX_POSIX_ACL_ACCESS]
= &ocfs2_xattr_acl_access_handler,
[OCFS2_XATTR_INDEX_POSIX_ACL_DEFAULT]
= &ocfs2_xattr_acl_default_handler,
#endif
[OCFS2_XATTR_INDEX_TRUSTED] = &ocfs2_xattr_trusted_handler,
[OCFS2_XATTR_INDEX_SECURITY] = &ocfs2_xattr_security_handler,
};
Expand Down
2 changes: 0 additions & 2 deletions fs/ocfs2/xattr.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,8 @@ struct ocfs2_security_xattr_info {
extern struct xattr_handler ocfs2_xattr_user_handler;
extern struct xattr_handler ocfs2_xattr_trusted_handler;
extern struct xattr_handler ocfs2_xattr_security_handler;
#ifdef CONFIG_OCFS2_FS_POSIX_ACL
extern struct xattr_handler ocfs2_xattr_acl_access_handler;
extern struct xattr_handler ocfs2_xattr_acl_default_handler;
#endif
extern struct xattr_handler *ocfs2_xattr_handlers[];

ssize_t ocfs2_listxattr(struct dentry *, char *, size_t);
Expand Down

0 comments on commit e6aabe0

Please sign in to comment.