mirror of
https://github.com/versity/scoutfs.git
synced 2026-02-07 11:10:44 +00:00
scoutfs: fix scoutfs_item_create() item leak
We'll leak the new item if we don't have lock coverage. Move the check around to fix this. Signed-off-by: Mark Fasheh <mfasheh@versity.com>
This commit is contained in:
@@ -1082,13 +1082,13 @@ int scoutfs_item_create(struct super_block *sb, struct scoutfs_key_buf *key,
|
||||
if (invalid_key_val(key, val))
|
||||
return -EINVAL;
|
||||
|
||||
if (WARN_ON_ONCE(!lock_coverage(lock, key, DLM_LOCK_EX)))
|
||||
return -EINVAL;
|
||||
|
||||
item = alloc_item(sb, key, val);
|
||||
if (!item)
|
||||
return -ENOMEM;
|
||||
|
||||
if (WARN_ON_ONCE(!lock_coverage(lock, key, DLM_LOCK_EX)))
|
||||
return -EINVAL;
|
||||
|
||||
do {
|
||||
spin_lock_irqsave(&cac->lock, flags);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user