]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
3.4-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Jun 2012 15:45:41 +0000 (08:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 13 Jun 2012 15:45:41 +0000 (08:45 -0700)
added patches:
btrfs-fall-back-to-non-inline-if-we-don-t-have-enough-space.patch

queue-3.4/btrfs-fall-back-to-non-inline-if-we-don-t-have-enough-space.patch [new file with mode: 0644]
queue-3.4/series

diff --git a/queue-3.4/btrfs-fall-back-to-non-inline-if-we-don-t-have-enough-space.patch b/queue-3.4/btrfs-fall-back-to-non-inline-if-we-don-t-have-enough-space.patch
new file mode 100644 (file)
index 0000000..981ae7a
--- /dev/null
@@ -0,0 +1,40 @@
+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: Btrfs: fall back to non-inline if we don't have enough space
+
+From: Josef Bacik <josef@redhat.com>
+
+commit 2adcac1a7331d93a17285804819caa96070b231f upstream.
+
+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>
+Acked-by: Chris Mason <chris.mason@fusionio.com>
+Cc: Alexandre Oliva <oliva@lsd.ic.unicamp.br>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/btrfs/inode.c |    5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
+
+--- a/fs/btrfs/inode.c
++++ b/fs/btrfs/inode.c
+@@ -257,10 +257,13 @@ static noinline int cow_file_range_inlin
+       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;
index 6540bdae67f8ed653559720045a2239e4bf3cd51..be2d72c37ad552429f7fdbbc3a0523e5b3b3f7ab 100644 (file)
@@ -12,3 +12,4 @@ x86-mce-amd-make-apic-lvt-thresholding-interrupt-optional.patch
 hwrng-atmel-rng-fix-race-condition-leading-to-repeated-bits.patch
 crypto-aesni-intel-fix-unaligned-cbc-decrypt-for-x86-32.patch
 drm-ttm-fix-buffer-object-metadata-accounting-regression-v2.patch
+btrfs-fall-back-to-non-inline-if-we-don-t-have-enough-space.patch