Re: [PATCH v3] qgroup: Retry after commit on getting EDQUOT

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

 



On Tue, Mar 14, 2017 at 05:23:50AM -0500, Goldwyn Rodrigues wrote:
> @@ -2402,6 +2404,19 @@ static int qgroup_reserve(struct btrfs_root *root, u64 num_bytes, bool enforce)
>  		qg = unode_aux_to_qgroup(unode);
>  
>  		if (enforce && !qgroup_check_limits(qg, num_bytes)) {
> +			if (!retried && qg->reserved > 0) {
> +				struct btrfs_trans_handle *trans;

Newline here

> +				spin_unlock(&fs_info->qgroup_lock);
> +				btrfs_start_delalloc_inodes(root, 0);

Do not ignore the return value, there seem to be some valid cases to
handle.

> +				btrfs_wait_ordered_extents(root, -1, 0,
> +						(u64)-1);
> +				trans = btrfs_join_transaction(root);
> +				if (IS_ERR(trans))
> +					return PTR_ERR(trans);
> +				btrfs_commit_transaction(trans);

Do not ignore return value from the commit.

> +				retried++;
> +				goto retry;
> +			}
>  			ret = -EDQUOT;
>  			goto out;
>  		}
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[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