@@ -4000,10 +4000,10 @@ static struct btrfs_trans_handle *__unlink_start_trans(struct inode *dir)
* 1 for the inode
*/
trans = btrfs_start_transaction(root, 5);
- if (!IS_ERR(trans) || PTR_ERR(trans) != -ENOSPC)
+ if (!IS_ERR(trans) || (PTR_ERR(trans) != -ENOSPC && PTR_ERR(trans) != -EDQUOT))
return trans;
- if (PTR_ERR(trans) == -ENOSPC) {
+ if (PTR_ERR(trans) == -ENOSPC || PTR_ERR(trans) == -EDQUOT) {
u64 num_bytes = btrfs_calc_trans_metadata_size(root, 5);
trans = btrfs_start_transaction(root, 0);
From: Justin Maggard <jmaggard10@gmail.com> Error messages saying, basically, "you don't have enough free space to free up space" make people angry. Sure, there are workarounds like truncating a file before removing it; but it's certainly not obvious. Unlink has a special case if we cannot make our reservations the normal way to try and see if there is enough slack room in the global reserve to migrate. Use the same retry for -EDQUOT. There are certainly other (probably more proper) ways to address this, but this is the least intrusive way that I could think of. --- fs/btrfs/inode.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)