Replicated (mirrored) components that are preferred for read or write.
For example, because they are located on SSD-based OSTs, or are more
local on the network to clients.
+.TP
+.B prefrd
+Replicated (mirrored) components that are preferred for read.
+.TP
+.B prefwr
+Replicated (mirrored) components that are preferred for write.
.RE
.TP
.BR --component-start | --comp-start
For example, because they are located on SSD-based OSTs, or are more
local on the network to clients.
.TP
+.B prefrd
+Replicated (mirrored) components that are preferred for read.
+.TP
+.B prefwr
+Replicated (mirrored) components that are preferred for write.
+.TP
.B nosync
Replicated (mirrored) components that do not resync using \fB
lfs mirror resync\fR. Files with the \fBnosync\fR flag will also
.B * prefer\fR - component preferred for read/write in a mirrored file
.RE
.RS
+.B * prefrd\fR - component preferred for read in a mirrored file
+.RE
+.RS
+.B * prefwr\fR - component preferred for write in a mirrored file
+.RE
+.RS
.B * stale\fR - component has outdated data in a mirrored file. This flag is
not allowed to be set on a component of the last non-stale mirror.
Once a component is marked
{ LCME_FL_INIT, "init" },
{ LCME_FL_STALE, "stale" },
{ LCME_FL_PREF_RW, "prefer" },
+ { LCME_FL_PREF_RD, "prefrd" },
+ { LCME_FL_PREF_WR, "prefwr" },
{ LCME_FL_OFFLINE, "offline" },
{ LCME_FL_NOSYNC, "nosync" },
{ LCME_FL_EXTENSION, "extension" },
local td=$DIR/$tdir
local tf=$td/$tfile
+ local flag
local ids
local i
cp /etc/hosts $tf || error "error writing file '$tf'"
$LFS mirror resync $tf || error "error resync-ing file '$tf'"
- $LFS setstripe --comp-set -I 0x20003 --comp-flags=prefer $tf ||
- error "error setting flag prefer"
+ for flag in prefer prefrd prefwr; do
+ $LFS setstripe --comp-set -I 0x20003 --comp-flags=$flag $tf ||
+ error "error setting flag $flag"
- verify_comp_attr lcme_flags $tf 0x20003 prefer
+ verify_comp_attr lcme_flags $tf 0x20003 $flag
- $LFS setstripe --comp-set -I 0x20003 --comp-flags=^prefer $tf ||
- error "error clearing prefer flag from component 0x20003"
+ $LFS setstripe --comp-set -I 0x20003 --comp-flags=^$flag $tf ||
+ error "error clearing $flag flag from component 0x20003"
+ done
# MDS disallows setting stale flag on the last non-stale mirror
[[ "$MDS1_VERSION" -ge $(version_code 2.12.57) ]] || return 0
" [[!] --blocks|-b N] [[!] --component-count [+-]<comp_cnt>]\n"
" [[!] --component-start [+-]N[kMGTPE]]\n"
" [[!] --component-end|-E [+-]N[kMGTPE]]\n"
- " [[!] --component-flags {init,stale,prefer,offline,nosync,extension}]\n"
+ " [[!] --component-flags {init,stale,prefer,prefrd,prefwr,offline,nosync,extension}]\n"
" [[!] --extension-size|--ext-size|-z [+-]N[kMGT]]\n"
" [[!] --foreign[=<foreign_type>]]\n"
" [[!] --gid|-g|--group|-G <gid>|<gname>] [--help|-h]\n"
return;
}
for (i = 0; i < ARRAY_SIZE(comp_flags_table); i++) {
- if (comp_flags & comp_flags_table[i].cfn_flag) {
+ const char *cfn_name = comp_flags_table[i].cfn_name;
+ __u32 cfn_flag = comp_flags_table[i].cfn_flag;
+
+ if ((comp_flags & cfn_flag) == cfn_flag) {
if (found)
llapi_printf(LLAPI_MSG_NORMAL, ",");
- llapi_printf(LLAPI_MSG_NORMAL, "%s",
- comp_flags_table[i].cfn_name);
+ llapi_printf(LLAPI_MSG_NORMAL, "%s", cfn_name);
comp_flags &= ~comp_flags_table[i].cfn_flag;
found = true;
}