mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git
synced 2024-11-27 14:14:30 +08:00
btrfs-progs: print error when zeroing device fails in device_zero_blocks()
Use the template to be verbose about device zeroing failure, this can be called repeatedly. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
060f7d6c81
commit
054b314fbe
@ -112,8 +112,11 @@ int device_zero_blocks(int fd, off_t start, size_t len, bool direct)
|
||||
return -ENOMEM;
|
||||
memset(buf, 0, len);
|
||||
written = btrfs_pwrite(fd, buf, len, start, direct);
|
||||
if (written != len)
|
||||
if (written != len) {
|
||||
error_msg(ERROR_MSG_WRITE, "zeroing range from %llu: %m",
|
||||
(unsigned long long)start);
|
||||
ret = -EIO;
|
||||
}
|
||||
free(buf);
|
||||
return ret;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user