From f4ab9ea706f2c6e4aad544145353b81afe7500e1 Mon Sep 17 00:00:00 2001 From: Josef Bacik Date: Tue, 17 Sep 2013 11:25:44 -0400 Subject: 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. Signed-off-by: Josef Bacik Signed-off-by: Chris Mason --- fs/btrfs/inode.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'fs/btrfs') diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c index abed81d93687..931036c6eb90 100644 --- a/fs/btrfs/inode.c +++ b/fs/btrfs/inode.c @@ -8216,6 +8216,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; } -- cgit v1.2.3-59-g8ed1b