mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
writecache: check watermark value
This commit is contained in:
parent
81d0333067
commit
84eab461c8
@ -5395,6 +5395,8 @@ static int _get_one_writecache_setting(struct cmd_context *cmd, struct writecach
|
||||
if (!strncmp(key, "high_watermark", strlen("high_watermark"))) {
|
||||
if (sscanf(val, "%llu", (unsigned long long *)&settings->high_watermark) != 1)
|
||||
goto_bad;
|
||||
if (settings->high_watermark > 100)
|
||||
goto_bad;
|
||||
settings->high_watermark_set = 1;
|
||||
return 1;
|
||||
}
|
||||
@ -5402,6 +5404,8 @@ static int _get_one_writecache_setting(struct cmd_context *cmd, struct writecach
|
||||
if (!strncmp(key, "low_watermark", strlen("low_watermark"))) {
|
||||
if (sscanf(val, "%llu", (unsigned long long *)&settings->low_watermark) != 1)
|
||||
goto_bad;
|
||||
if (settings->low_watermark > 100)
|
||||
goto_bad;
|
||||
settings->low_watermark_set = 1;
|
||||
return 1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user