After "LU-6030 osd-ldiskfs: improve mount option handling landing",
mkfs.lustre lost ability to store non ldiskfs persistent options, because their
support was stripped out from ldiskfs layer.
This patch makes ldiskfs mount independent from the mount options from mkfs.lustre
command string.
Change-Id: I63e2efb84249eae8294ce33a72894aeb52563ad5
Xyratex-bug-id: MRP-2819
Signed-off-by: Alexander Zarochentsev <alexander.zarochentsev@seagate.com>
Reviewed-on: http://review.whamcloud.com/15937
Reviewed-by: Alex Zhuravlev <alexey.zhuravlev@intel.com>
Tested-by: Jenkins
Reviewed-by: Andreas Dilger <andreas.dilger@intel.com>
Reviewed-by: Yang Sheng <yang.sheng@intel.com>
Reviewed-by: Andrew Perepechko <andrew.perepechko@seagate.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Format options for the backing fs. For example, ext3 options could be set here.
.TP
.BI \--mountfsoptions= opts
Format options for the backing fs. For example, ext3 options could be set here.
.TP
.BI \--mountfsoptions= opts
-Set the mount options that will be used when mounting the backing fs.
+Set the persistent mount options that will be used when mounting Lustre fs.
WARNING: unlike earlier versions of \fBmkfs.lustre\fR, this version completely
replaces the default mount options with those specified on the command line,
issuing a warning on stderr if any of the default mount options are omitted.
WARNING: unlike earlier versions of \fBmkfs.lustre\fR, this version completely
replaces the default mount options with those specified on the command line,
issuing a warning on stderr if any of the default mount options are omitted.
MGS/MDT: \fIerrors=remount-ro,user_xattr\fR.
\fBDO NOT\fR alter the default mount options unless you know what you are doing.
.TP
MGS/MDT: \fIerrors=remount-ro,user_xattr\fR.
\fBDO NOT\fR alter the default mount options unless you know what you are doing.
.TP
+.BI \--backfs-mount-opts=opts
+Use these options for mounting backing fs while mkfs.lustre is working.
+.TP
.BI \--network= net,...
Network(s) to restrict this ost/mdt to. This option can be repeated as desired.
.TP
.BI \--network= net,...
Network(s) to restrict this ost/mdt to. This option can be repeated as desired.
.TP
Force a particular OST or MDT index
.TP
.BI \--mountfsoptions= opts
Force a particular OST or MDT index
.TP
.BI \--mountfsoptions= opts
-Set the mount options that will be used when mounting the backing fs.
+Set the persistent mount options that will be used when Lustre fs.
WARNING: unlike earlier versions of \fBtunefs.lustre\fR, this version
completely replaces the existing mount options with those specified on
the command line, issuing a warning on stderr if any of the default
WARNING: unlike earlier versions of \fBtunefs.lustre\fR, this version
completely replaces the existing mount options with those specified on
the command line, issuing a warning on stderr if any of the default
MGS/MDT: \fIerrors=remount-ro,user_xattr\fR.
\fBDO NOT\fR alter the default mount options unless you know what you are doing.
.TP
MGS/MDT: \fIerrors=remount-ro,user_xattr\fR.
\fBDO NOT\fR alter the default mount options unless you know what you are doing.
.TP
+.BI \--backfs-mount-opts=opts
+Use these options for mounting backing fs while tune.lustre is working.
+.TP
.BI \--network= net,...
Network(s) to restrict this ost/mdt to. This option can be repeated as desired.
.TP
.BI \--network= net,...
Network(s) to restrict this ost/mdt to. This option can be repeated as desired.
.TP
"\t\t\trequired for all targets other than MGS\n"
"\t\t--mgsnode=<nid>[,<...>]: NID(s) of remote MGS\n"
"\t\t\trequired for all targets other than MGS\n"
"\t\t\trequired for all targets other than MGS\n"
"\t\t--mgsnode=<nid>[,<...>]: NID(s) of remote MGS\n"
"\t\t\trequired for all targets other than MGS\n"
- "\t\t--mountfsoptions=<opts>: permanent mount options\n"
+ "\t\t--mountfsoptions=<opts>: permanent Lustre mount options\n"
+ "\t\t--backfs-mount-opts=<opts>: backing fs mount options\n"
"\t\t--failnode=<nid>[,<...>]: NID(s) of backup failover node\n"
"\t\t\tmutually exclusive with --servicenode\n"
"\t\t--servicenode=<nid>[,<...>]: NID(s) of service partners\n"
"\t\t--failnode=<nid>[,<...>]: NID(s) of backup failover node\n"
"\t\t\tmutually exclusive with --servicenode\n"
"\t\t--servicenode=<nid>[,<...>]: NID(s) of service partners\n"
{
static struct option long_opt[] = {
{ "backfstype", required_argument, NULL, 'b' },
{
static struct option long_opt[] = {
{ "backfstype", required_argument, NULL, 'b' },
+ { "backfs-mount-opts", required_argument, NULL, 'B' },
{ "stripe-count-hint", required_argument, NULL, 'c' },
{ "comment", required_argument, NULL, 'u' },
{ "configdev", required_argument, NULL, 'C' },
{ "stripe-count-hint", required_argument, NULL, 'c' },
{ "comment", required_argument, NULL, 'u' },
{ "configdev", required_argument, NULL, 'C' },
+ case 'B':
+ mop->mo_mountopts = optarg;
+ break;
case 'c':
if (IS_MDT(&mop->mo_ldd)) {
int stripe_count = atol(optarg);
case 'c':
if (IS_MDT(&mop->mo_ldd)) {
int stripe_count = atol(optarg);
char **mo_pool_vdevs; /* list of pool vdevs */
char mo_loopdev[128]; /* in case a loop dev is needed */
char mo_mkfsopts[512]; /* options to the backing-store mkfs */
char **mo_pool_vdevs; /* list of pool vdevs */
char mo_loopdev[128]; /* in case a loop dev is needed */
char mo_mkfsopts[512]; /* options to the backing-store mkfs */
+ char *mo_mountopts; /* mount options for backing fs */
__u64 mo_device_kb; /* in KB */
int mo_stripe_count;
int mo_flags;
__u64 mo_device_kb; /* in KB */
int mo_stripe_count;
int mo_flags;
dev = mop->mo_loopdev;
ret = mount(dev, mntpt, MT_STR(&mop->mo_ldd), 0,
dev = mop->mo_loopdev;
ret = mount(dev, mntpt, MT_STR(&mop->mo_ldd), 0,
- mop->mo_ldd.ldd_mount_opts);
+ (mop->mo_mountopts == NULL) ?
+ "errors=remount-ro" : mop->mo_mountopts);
if (ret) {
fprintf(stderr, "%s: Unable to mount %s: %s\n",
progname, dev, strerror(errno));
if (ret) {
fprintf(stderr, "%s: Unable to mount %s: %s\n",
progname, dev, strerror(errno));