1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

bcache: intercept test mode before write

Don't allow writes in test mode.  test mode should be
more sophisticated than just faking writes, and this
should be a last defense for cases where test mode is
not being checked correctly.
This commit is contained in:
David Teigland 2018-04-09 13:57:44 -05:00
parent 9b6a62f944
commit aa833bdd8a

View File

@ -922,6 +922,9 @@ bool dev_write_bytes(struct device *dev, off_t start, size_t len, void *data)
{ {
int ret; int ret;
if (test_mode())
return true;
if (!scan_bcache) { if (!scan_bcache) {
if (!dev_open(dev)) if (!dev_open(dev))
return false; return false;
@ -955,6 +958,9 @@ bool dev_write_zeros(struct device *dev, off_t start, size_t len)
{ {
int ret; int ret;
if (test_mode())
return true;
if (!scan_bcache) { if (!scan_bcache) {
if (!dev_open(dev)) if (!dev_open(dev))
return false; return false;