[ 3.5.y.z extended stable ] Patch "Btrfs: cleanup orphan reservation if truncate fails" has been added to staging queue

Luis Henriques luis.henriques at canonical.com
Mon Mar 11 12:07:59 UTC 2013


This is a note to let you know that I have just added a patch titled

    Btrfs: cleanup orphan reservation if truncate fails

to the linux-3.5.y-queue branch of the 3.5.y.z extended stable tree 
which can be found at:

 http://kernel.ubuntu.com/git?p=ubuntu/linux.git;a=shortlog;h=refs/heads/linux-3.5.y-queue

If you, or anyone else, feels it should not be added to this tree, please 
reply to this email.

For more information about the 3.5.y.z tree, see
https://wiki.ubuntu.com/Kernel/Dev/ExtendedStable

Thanks.
-Luis

------

>From 87adc20e4b6adc1b3f8bf243579eeb69bb227ded Mon Sep 17 00:00:00 2001
From: Josef Bacik <jbacik at fusionio.com>
Date: Thu, 7 Feb 2013 16:27:28 -0500
Subject: [PATCH] Btrfs: cleanup orphan reservation if truncate fails

commit 4a7d0f6854c4a4ad1dba00a3b128a32d39b9a742 upstream.

I noticed we were getting lots of warnings with xfstest 83 because we have
reservations outstanding.  This is because we moved the orphan add outside
of the truncate, but we don't actually cleanup our reservation if something
fails.  This fixes the problem and I no longer see warnings.  Thanks,

Signed-off-by: Josef Bacik <jbacik at fusionio.com>
Signed-off-by: Luis Henriques <luis.henriques at canonical.com>
---
 fs/btrfs/inode.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index fadf1c3..07230f7 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -2444,6 +2444,8 @@ int btrfs_orphan_cleanup(struct btrfs_root *root)
 			}
 			nr_truncate++;
 			ret = btrfs_truncate(inode);
+			if (ret)
+				btrfs_orphan_del(NULL, inode);
 		} else {
 			nr_unlink++;
 		}
--
1.8.1.2





More information about the kernel-team mailing list