linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ceph-on-btrfs inline-cow regression fix for 3.4.3
@ 2012-06-13  3:46 Alexandre Oliva
  2012-06-13  5:04 ` Chris Samuel
  2012-06-13 14:33 ` Chris Mason
  0 siblings, 2 replies; 3+ messages in thread
From: Alexandre Oliva @ 2012-06-13  3:46 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Josef Bacik, Chris Mason, stable, linux-btrfs, ceph-devel

[-- Attachment #1: Type: text/plain, Size: 1019 bytes --]

Hi, Greg,

There's a btrfs regression in 3.4 that's causing a lot of grief to
ceph-on-btrfs users like myself.  This small and nice patch cures it.
It's in Linus' master already.  I've been running it on top of 3.4.2,
and it would be very convenient for me if this could be in 3.4.3.

Although the patch mentions ENOSPC, the fix has nothing to do with disk
full conditions; it's more along the lines of not finding enough room
for inline data contents and/or failing to split the btree nodes to make
room for it.  I don't know that anyone knows for sure, but without this
patch what we get is a horrible error, that can only be fixed with a
reboot.  Yeah, not even umount&&mount will make the filesystem writable
again.  The fix makes us return an error condition in this case, that
callers are prepared to deal with.

I know btrfs hasn't had maintenance fixes in stable series, but Chris
Mason tells me the only reason is that nobody stepped up to do so.
Given my interest, I might as well give it a try ;-)

Thanks,


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Btrfs-fall-back-to-non-inline-if-we-don-t-have-enoug.patch --]
[-- Type: text/x-diff, Size: 1282 bytes --]

>From 2adcac1a7331d93a17285804819caa96070b231f Mon Sep 17 00:00:00 2001
From: Josef Bacik <josef@redhat.com>
Date: Wed, 23 May 2012 16:10:14 -0400
Subject: [PATCH] Btrfs: fall back to non-inline if we don't have enough space

If cow_file_range_inline fails with ENOSPC we abort the transaction which
isn't very nice.  This really shouldn't be happening anyways but there's no
sense in making it a horrible error when we can easily just go allocate
normal data space for this stuff.  Thanks,

Signed-off-by: Josef Bacik <josef@redhat.com>
---
 fs/btrfs/inode.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index 0298928..92df0a5 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -257,10 +257,13 @@ static noinline int cow_file_range_inline(struct btrfs_trans_handle *trans,
 	ret = insert_inline_extent(trans, root, inode, start,
 				   inline_len, compressed_size,
 				   compress_type, compressed_pages);
-	if (ret) {
+	if (ret && ret != -ENOSPC) {
 		btrfs_abort_transaction(trans, root, ret);
 		return ret;
+	} else if (ret == -ENOSPC) {
+		return 1;
 	}
+
 	btrfs_delalloc_release_metadata(inode, end + 1 - start);
 	btrfs_drop_extent_cache(inode, start, aligned_end - 1, 0);
 	return 0;
-- 
1.7.7.6


[-- Attachment #3: Type: text/plain, Size: 258 bytes --]



-- 
Alexandre Oliva, freedom fighter    http://FSFLA.org/~lxoliva/
You must be the change you wish to see in the world. -- Gandhi
Be Free! -- http://FSFLA.org/   FSF Latin America board member
Free Software Evangelist      Red Hat Brazil Compiler Engineer

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: ceph-on-btrfs inline-cow regression fix for 3.4.3
  2012-06-13  3:46 ceph-on-btrfs inline-cow regression fix for 3.4.3 Alexandre Oliva
@ 2012-06-13  5:04 ` Chris Samuel
  2012-06-13 14:33 ` Chris Mason
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Samuel @ 2012-06-13  5:04 UTC (permalink / raw)
  To: Alexandre Oliva
  Cc: Greg Kroah-Hartman, Josef Bacik, Chris Mason, stable, linux-btrfs,
	ceph-devel

On 13/06/12 13:46, Alexandre Oliva wrote:

> I know btrfs hasn't had maintenance fixes in stable series, but Chris
> Mason tells me the only reason is that nobody stepped up to do so.
> Given my interest, I might as well give it a try ;-)

Actually 3.3.3 had a fix for btrfs in it.. :-)

http://lwn.net/Articles/493971/

cheers,
Chris
-- 
 Chris Samuel  :  http://www.csamuel.org/  :  Melbourne, VIC

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: ceph-on-btrfs inline-cow regression fix for 3.4.3
  2012-06-13  3:46 ceph-on-btrfs inline-cow regression fix for 3.4.3 Alexandre Oliva
  2012-06-13  5:04 ` Chris Samuel
@ 2012-06-13 14:33 ` Chris Mason
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Mason @ 2012-06-13 14:33 UTC (permalink / raw)
  To: Alexandre Oliva
  Cc: Greg Kroah-Hartman, Josef Bacik, Chris Mason,
	stable@vger.kernel.org, linux-btrfs@vger.kernel.org,
	ceph-devel@vger.kernel.org

On Tue, Jun 12, 2012 at 09:46:26PM -0600, Alexandre Oliva wrote:
> Hi, Greg,
> 
> There's a btrfs regression in 3.4 that's causing a lot of grief to
> ceph-on-btrfs users like myself.  This small and nice patch cures it.
> It's in Linus' master already.  I've been running it on top of 3.4.2,
> and it would be very convenient for me if this could be in 3.4.3.

Ack, this can definitely to go 3.4-stable.  Thanks Alexandre.

-chris

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-06-13 14:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-13  3:46 ceph-on-btrfs inline-cow regression fix for 3.4.3 Alexandre Oliva
2012-06-13  5:04 ` Chris Samuel
2012-06-13 14:33 ` Chris Mason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).