Skip to contentSkip to conversation

Btrfs: iput inode on allocation failure

PATCH New Josef Bacik 1 participant 1 message Sep 17, 2013 Btrfs file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Btrfs: iput inode on allocation failure

We don't do the iput when we fail to allocate our delayed delalloc work in __start_delalloc_inodes, fix this.

---
 fs/btrfs/inode.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
fs/btrfs/inode.c +4 -0
index 85a4900..7988113 100644
@@ -8211,6 +8211,10 @@ static int __start_delalloc_inodes(struct btrfs_root *root, int delay_iput)
 
 		work = btrfs_alloc_delalloc_work(inode, 0, delay_iput);
 		if (unlikely(!work)) {
+			if (delay_iput)
+				btrfs_add_delayed_iput(inode);
+			else
+				iput(inode);
 			ret = -ENOMEM;
 			goto out;
 		}
Signature · 1 line
1.7.7.6