X-Git-Url: https://git.whamcloud.com/?a=blobdiff_plain;f=lustre%2Futils%2Flibmount_utils_ldiskfs.c;h=1ee361219cde62a396d7a32cc85f1dd7ec2a9891;hb=f07508d17b49574c7ea47a855c6e8af2b23c3add;hp=bf97b95923d99744d1024ddc475bc229f1c2bcf2;hpb=c632a238e6d0c4a3240959a894d36a8a409d64f8;p=fs%2Flustre-release.git diff --git a/lustre/utils/libmount_utils_ldiskfs.c b/lustre/utils/libmount_utils_ldiskfs.c index bf97b95..1ee3612 100644 --- a/lustre/utils/libmount_utils_ldiskfs.c +++ b/lustre/utils/libmount_utils_ldiskfs.c @@ -74,10 +74,6 @@ #include #include -#ifdef HAVE_SELINUX -#include -#endif - #include "mount_utils.h" #define MAX_HW_SECTORS_KB_PATH "queue/max_hw_sectors_kb" @@ -98,30 +94,6 @@ static void append_unique(char *buf, char *prefix, char *key, char *val, static bool is_e2fsprogs_feature_supp(const char *feature); static void disp_old_e2fsprogs_msg(const char *feature, int make_backfs); -/* - * Concatenate context of the temporary mount point if selinux is enabled - */ -#ifdef HAVE_SELINUX -static void append_context_for_mount(char *mntpt, struct mkfs_opts *mop) -{ - security_context_t fcontext; - - if (getfilecon(mntpt, &fcontext) < 0) { - /* Continuing with default behaviour */ - fprintf(stderr, "%s: Get file context failed : %s\n", - progname, strerror(errno)); - return; - } - - if (fcontext != NULL) { - append_unique(mop->mo_ldd.ldd_mount_opts, - ",", "context", fcontext, - sizeof(mop->mo_ldd.ldd_mount_opts)); - freecon(fcontext); - } -} -#endif - /* Determine if a device is a block device (as opposed to a file) */ static int is_block(char *devname) { @@ -204,14 +176,6 @@ int ldiskfs_write_ldd(struct mkfs_opts *mop) return errno; } - /* - * Append file context to mount options if SE Linux is enabled - */ - #ifdef HAVE_SELINUX - if (is_selinux_enabled() > 0) - append_context_for_mount(mntpt, mop); - #endif - dev = mop->mo_device; if (mop->mo_flags & MO_IS_LOOP) dev = mop->mo_loopdev; @@ -392,9 +356,9 @@ static void disp_old_e2fsprogs_msg(const char *feature, int make_backfs) "to enable this feature.\n"); #endif if (make_backfs) - fprintf(stderr, "Feature will not be enabled until %s" - "is updated and '%s -O %s %%{device}' " - "is run.\n\n", E2FSPROGS, TUNE2FS, feature); + fprintf(stderr, + "Feature will not be enabled until %s is updated and '%s -O %s %%{device}' is run.\n\n", + E2FSPROGS, TUNE2FS, feature); } /* Check whether the file exists in the device */ @@ -607,6 +571,14 @@ static int enable_default_ext4_features(struct mkfs_opts *mop, char *anchor, if (enable_64bit || strstr(mop->mo_mkfsopts, "meta_bg")) append_unique(anchor, ",", "^resize_inode", NULL, maxbuflen); + /* Allow xattrs larger than one block, stored in a separate inode */ + if (IS_MDT(&mop->mo_ldd) && is_e2fsprogs_feature_supp("-O ea_inode")) + append_unique(anchor, ",", "ea_inode", NULL, maxbuflen); + + /* Allow more than 10M directory entries */ + if (IS_MDT(&mop->mo_ldd) && is_e2fsprogs_feature_supp("-O large_dir")) + append_unique(anchor, ",", "large_dir", NULL, maxbuflen); + /* Cluster inode/block bitmaps and inode table for more efficient IO. * Align the flex groups on a 1MB boundary for better performance. */ /* This -O feature needs to go last, since it adds the "-G" option. */ @@ -1408,14 +1380,6 @@ int ldiskfs_rename_fsname(struct mkfs_opts *mop, const char *oldname) return ret; } -#ifdef HAVE_SELINUX - /* - * Append file context to mount options if SE Linux is enabled - */ - if (is_selinux_enabled() > 0) - append_context_for_mount(mntpt, mop); -#endif - if (mop->mo_flags & MO_IS_LOOP) dev = mop->mo_loopdev; else