mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-28 05:34:13 -05:00
xfs: don't treat all radix_tree_insert errors as -EEXIST
Return other errors to the caller instead. Note that there really shouldn't be any other errors because the entry is preallocated, but if there were, we'd better return them instead of retrying forever. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Carlos Maiolino <cem@kernel.org>
This commit is contained in:
committed by
Carlos Maiolino
parent
005d5ae0c5
commit
36cebabde7
@@ -860,7 +860,6 @@ xfs_qm_dqget_cache_insert(
|
||||
mutex_lock(&qi->qi_tree_lock);
|
||||
error = radix_tree_insert(tree, id, dqp);
|
||||
if (unlikely(error)) {
|
||||
/* Duplicate found! Caller must try again. */
|
||||
trace_xfs_dqget_dup(dqp);
|
||||
goto out_unlock;
|
||||
}
|
||||
@@ -935,13 +934,16 @@ xfs_qm_dqget(
|
||||
|
||||
error = xfs_qm_dqget_cache_insert(mp, qi, tree, id, dqp);
|
||||
if (error) {
|
||||
/*
|
||||
* Duplicate found. Just throw away the new dquot and start
|
||||
* over.
|
||||
*/
|
||||
xfs_qm_dqdestroy(dqp);
|
||||
XFS_STATS_INC(mp, xs_qm_dquot_dups);
|
||||
goto restart;
|
||||
if (error == -EEXIST) {
|
||||
/*
|
||||
* Duplicate found. Just throw away the new dquot and
|
||||
* start over.
|
||||
*/
|
||||
XFS_STATS_INC(mp, xs_qm_dquot_dups);
|
||||
goto restart;
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
trace_xfs_dqget_miss(dqp);
|
||||
@@ -1060,13 +1062,16 @@ xfs_qm_dqget_inode(
|
||||
|
||||
error = xfs_qm_dqget_cache_insert(mp, qi, tree, id, dqp);
|
||||
if (error) {
|
||||
/*
|
||||
* Duplicate found. Just throw away the new dquot and start
|
||||
* over.
|
||||
*/
|
||||
xfs_qm_dqdestroy(dqp);
|
||||
XFS_STATS_INC(mp, xs_qm_dquot_dups);
|
||||
goto restart;
|
||||
if (error == -EEXIST) {
|
||||
/*
|
||||
* Duplicate found. Just throw away the new dquot and
|
||||
* start over.
|
||||
*/
|
||||
XFS_STATS_INC(mp, xs_qm_dquot_dups);
|
||||
goto restart;
|
||||
}
|
||||
return error;
|
||||
}
|
||||
|
||||
dqret:
|
||||
|
||||
Reference in New Issue
Block a user