Sets the stripe cache size for server side disk with a striped raid
configuration.
.TP
+.BI max_sectors_kb
+Automatically Sets the block device parameter of 'max_sectors_kb' for the
+MDT or OST target. When max_sectors_kb isn't specified, that parameter for
+block device will be set to same as it's own 'max_hw_sectors_kb' (up to a
+maximum of 16M), this is default behavior suited for most users. When
+max_sectors_kb is specified as zero, the old parameter value will be kept.
+When max_sectors_kb is specified as a positive number, the parameter will
+be set to this number arbitrarily.
+.TP
.BI recovery_time_soft= timeout
Allow 'timeout' seconds for clients to reconnect for recovery after a server
crash. This timeout will be incrementally extended if it is about to expire
/* please note that some ldiskfs mount options are also in
* the form of param=value. We should pay attention not to
* remove those mount options, see bug 22097. */
- if (val && strncmp(arg, "md_stripe_cache_size", 20) == 0) {
+ if (val && strncmp(arg, "max_sectors_kb", 14) == 0) {
+ mop->mo_max_sectors_kb = atoi(val + 1);
+ } else if (val &&
+ strncmp(arg, "md_stripe_cache_size", 20) == 0) {
mop->mo_md_stripe_cache_size = atoi(val + 1);
} else if (val && strncmp(arg, "retry", 5) == 0) {
mop->mo_retry = atoi(val + 1);
mop->mo_md_stripe_cache_size = 16384;
mop->mo_orig_options = "";
mop->mo_nosvc = 0;
+ mop->mo_max_sectors_kb = -1;
}
static int parse_opts(int argc, char *const argv[], struct mount_opts *mop)
return rc;
}
- snprintf(real_path, sizeof(real_path), "%s/%s", path,
- MAX_HW_SECTORS_KB_PATH);
- rc = read_file(real_path, buf, sizeof(buf));
- if (rc) {
- if (verbose)
- fprintf(stderr, "warning: opening %s: %s\n",
- real_path, strerror(errno));
- /* No MAX_HW_SECTORS_KB_PATH isn't necessary an
- * error for some device. */
- goto subdevs;
+ if (mop->mo_max_sectors_kb >= 0) {
+ snprintf(buf, sizeof(buf), "%d", mop->mo_max_sectors_kb);
+ } else {
+ snprintf(real_path, sizeof(real_path), "%s/%s", path,
+ MAX_HW_SECTORS_KB_PATH);
+ rc = read_file(real_path, buf, sizeof(buf));
+ if (rc) {
+ if (verbose)
+ fprintf(stderr, "warning: opening %s: %s\n",
+ real_path, strerror(errno));
+ /* No MAX_HW_SECTORS_KB_PATH isn't necessary an
+ * error for some device. */
+ goto subdevs;
+ }
}
if (strlen(buf) - 1 > 0) {
* PTLRPC_MAX_BRW_SIZE, but that isn't in a public header.
* Note that even though the block layer allows larger values,
* setting max_sectors_kb = 32768 causes crashes (LU-6974). */
- if (newval > 16 * 1024) {
+ if (mop->mo_max_sectors_kb < 0 && newval > 16 * 1024) {
newval = 16 * 1024;
snprintf(buf, sizeof(buf), "%llu", newval);
}
oldval = strtoull(oldbuf, &end, 0);
/* Don't shrink the current limit. */
- if (oldval != ULLONG_MAX && newval <= oldval)
+ if (mop->mo_max_sectors_kb < 0 && oldval != ULLONG_MAX &&
+ newval <= oldval)
goto subdevs;
rc = write_file(real_path, buf);