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

login
register
mail settings
Submitter Luis Henriques
Date March 11, 2013, 12:07 p.m.
Message ID <1363003679-3580-1-git-send-email-luis.henriques@canonical.com>
Download mbox | patch
Permalink /patch/226555/
State New
Headers show

Comments

Luis Henriques - March 11, 2013, 12:07 p.m.
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@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@fusionio.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
---
 fs/btrfs/inode.c | 2 ++
 1 file changed, 2 insertions(+)

--
1.8.1.2
Josef Bacik - March 11, 2013, 1:47 p.m.
On Mon, Mar 11, 2013 at 06:07:59AM -0600, Luis Henriques wrote:
> 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
> 

This isn't needed for 3.5, only 3.8.

Josef
Luis Henriques - March 11, 2013, 1:55 p.m.
On Mon, Mar 11, 2013 at 09:47:57AM -0400, Josef Bacik wrote:
> On Mon, Mar 11, 2013 at 06:07:59AM -0600, Luis Henriques wrote:
> > 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
> > 
> 
> This isn't needed for 3.5, only 3.8.

I'll drop this patch from the queue then.  Thanks for the feedback.

Cheers,
--
Luis

Patch

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++;
 		}