mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
bcache_write_bytes needs to be followed by flush
The improved bcache_write_bytes is not flushing, so the caller needs to do that.
This commit is contained in:
parent
a418f88b76
commit
8dcc973bbb
@ -946,7 +946,14 @@ bool dev_write_bytes(struct device *dev, off_t start, size_t len, void *data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!bcache_write_bytes(scan_bcache, dev->bcache_fd, start, len, data)) {
|
if (!bcache_write_bytes(scan_bcache, dev->bcache_fd, start, len, data)) {
|
||||||
log_error("dev_write_bytes %s at %u failed invalidate fd %d",
|
log_error("dev_write_bytes %s at %u bcache write failed invalidate fd %d",
|
||||||
|
dev_name(dev), (uint32_t)start, dev->bcache_fd);
|
||||||
|
label_scan_invalidate(dev);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bcache_flush(scan_bcache)) {
|
||||||
|
log_error("dev_write_bytes %s at %u bcache flush failed invalidate fd %d",
|
||||||
dev_name(dev), (uint32_t)start, dev->bcache_fd);
|
dev_name(dev), (uint32_t)start, dev->bcache_fd);
|
||||||
label_scan_invalidate(dev);
|
label_scan_invalidate(dev);
|
||||||
return false;
|
return false;
|
||||||
@ -982,7 +989,14 @@ bool dev_write_zeros(struct device *dev, off_t start, size_t len)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!bcache_write_zeros(scan_bcache, dev->bcache_fd, start, len)) {
|
if (!bcache_write_zeros(scan_bcache, dev->bcache_fd, start, len)) {
|
||||||
log_error("dev_write_zeros %s at %u failed invalidate fd %d",
|
log_error("dev_write_zeros %s at %u bcache write failed invalidate fd %d",
|
||||||
|
dev_name(dev), (uint32_t)start, dev->bcache_fd);
|
||||||
|
label_scan_invalidate(dev);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!bcache_flush(scan_bcache)) {
|
||||||
|
log_error("dev_write_zeros %s at %u bcache flush failed invalidate fd %d",
|
||||||
dev_name(dev), (uint32_t)start, dev->bcache_fd);
|
dev_name(dev), (uint32_t)start, dev->bcache_fd);
|
||||||
label_scan_invalidate(dev);
|
label_scan_invalidate(dev);
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user