summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosef Bacik <jbacik@fusionio.com>2013-09-17 11:25:44 -0400
committerChris Mason <chris.mason@fusionio.com>2013-09-21 11:05:28 -0400
commitf4ab9ea706f2c6e4aad544145353b81afe7500e1 (patch)
tree7fa34b634e182d7c27da878922a4f0de7eb5fcfe
parent363e4d354e51558629d13c5ae456f98c4b209576 (diff)
downloadop-kernel-dev-f4ab9ea706f2c6e4aad544145353b81afe7500e1.zip
op-kernel-dev-f4ab9ea706f2c6e4aad544145353b81afe7500e1.tar.gz
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 <jbacik@fusionio.com> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r--fs/btrfs/inode.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index abed81d..931036c6 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;
}
OpenPOWER on IntegriCloud