[PATCH] btrfs: Return EBUSY in case btrfs_start_write_no_snapshotting fails

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If btrfs_start_write_no_snapshotting fails (returns 0) it means there
is snapshot in progress hence resource is busy and not that we are
out of space. Change the return value to correctly reflect this.

Signed-off-by: Nikolay Borisov <nborisov@xxxxxxxx>
---
 fs/btrfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/btrfs/file.c b/fs/btrfs/file.c
index 2030b9bcb977..ce1dec51ff92 100644
--- a/fs/btrfs/file.c
+++ b/fs/btrfs/file.c
@@ -1547,7 +1547,7 @@ static noinline int check_can_nocow(struct btrfs_inode *inode, loff_t pos,
 
 	ret = btrfs_start_write_no_snapshotting(root);
 	if (!ret)
-		return -ENOSPC;
+		return -EBUSY;
 
 	lockstart = round_down(pos, fs_info->sectorsize);
 	lockend = round_up(pos + *write_bytes,
-- 
2.17.1




[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux