On 5/29/19 6:35 PM, Wols Lists wrote:
On 27/05/19 05:05, Guoqing Jiang wrote:
+This variable sets a limit on the number of concurrent background writes,
+the valid values are 0 to 256, 0 means that write-behind is not allowed,
+while any other number means it can happen. If there are more write requests
+than the number, new writes will by synchronous.
Is this a byte-wide or an integer field? 0 to 256 is an odd number -
surely it should be 255 (0xff)?
Thanks for the checking.
Actually the range should from 0 to 16383, since there is one checking
inside kernel.
if (backlog > COUNTER_MAX)
return -EINVAL;
#define COUNTER_BITS 16
#define RESYNC_MASK ((bitmap_counter_t) (1 << (COUNTER_BITS - 2)))
#define COUNTER_MAX ((bitmap_counter_t) RESYNC_MASK - 1)
And mdadm has similar code.
s.write_behind = parse_num(optarg);
if (s.write_behind < 0 ||
s.write_behind > 16383) {
pr_err("Invalid value for
maximum outstanding write-behind writes: %s.\n\tMust be between 0 and
16383.\n", optarg);
exit(2);
}
Thanks & Regards,
Guoqing