mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 04:33:26 +02:00
XArray: Change xa_insert to return -EBUSY
Userspace translates EEXIST to "File exists" which isn't a very good error message for the problem. "Device or resource busy" is a better indication of what went wrong. Signed-off-by: Matthew Wilcox <willy@infradead.org>
This commit is contained in:
@@ -1451,7 +1451,7 @@ EXPORT_SYMBOL(__xa_cmpxchg);
|
||||
*
|
||||
* Context: Any context. Expects xa_lock to be held on entry. May
|
||||
* release and reacquire xa_lock if @gfp flags permit.
|
||||
* Return: 0 if the store succeeded. -EEXIST if another entry was present.
|
||||
* Return: 0 if the store succeeded. -EBUSY if another entry was present.
|
||||
* -ENOMEM if memory could not be allocated.
|
||||
*/
|
||||
int __xa_insert(struct xarray *xa, unsigned long index, void *entry, gfp_t gfp)
|
||||
@@ -1471,7 +1471,7 @@ int __xa_insert(struct xarray *xa, unsigned long index, void *entry, gfp_t gfp)
|
||||
if (xa_track_free(xa))
|
||||
xas_clear_mark(&xas, XA_FREE_MARK);
|
||||
} else {
|
||||
xas_set_err(&xas, -EEXIST);
|
||||
xas_set_err(&xas, -EBUSY);
|
||||
}
|
||||
} while (__xas_nomem(&xas, gfp));
|
||||
|
||||
|
Reference in New Issue
Block a user