* [PATCH] Btrfs: release space on error in page_mkwrite
@ 2012-01-10 19:20 Josef Bacik
2012-01-11 14:27 ` David Sterba
0 siblings, 1 reply; 3+ messages in thread
From: Josef Bacik @ 2012-01-10 19:20 UTC (permalink / raw)
To: linux-btrfs, dsterba
If updating the inode gave us an ENOSPC we were just returning in page_mkwrite,
which is a problem since we make our reservation right before trying to update
the inode, so fix the out label so that we actually free our reservation.
Thanks,
Signed-off-by: Josef Bacik <josef@redhat.com>
---
fs/btrfs/inode.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
index b0d7777..90a32f1 100644
--- a/fs/btrfs/inode.c
+++ b/fs/btrfs/inode.c
@@ -6509,8 +6509,8 @@ out_unlock:
if (!ret)
return VM_FAULT_LOCKED;
unlock_page(page);
- btrfs_delalloc_release_space(inode, PAGE_CACHE_SIZE);
out:
+ btrfs_delalloc_release_space(inode, PAGE_CACHE_SIZE);
return ret;
}
--
1.7.5.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Btrfs: release space on error in page_mkwrite
2012-01-10 19:20 [PATCH] Btrfs: release space on error in page_mkwrite Josef Bacik
@ 2012-01-11 14:27 ` David Sterba
2012-01-12 11:59 ` David Sterba
0 siblings, 1 reply; 3+ messages in thread
From: David Sterba @ 2012-01-11 14:27 UTC (permalink / raw)
To: Josef Bacik; +Cc: linux-btrfs, dsterba
On Tue, Jan 10, 2012 at 02:20:18PM -0500, Josef Bacik wrote:
> If updating the inode gave us an ENOSPC we were just returning in page_mkwrite,
> which is a problem since we make our reservation right before trying to update
> the inode, so fix the out label so that we actually free our reservation.
> Thanks,
>
> Signed-off-by: Josef Bacik <josef@redhat.com>
Tested-by: David Sterba <dsterba@suse.cz>
reproducer:
while :;do ./check 209;done
and some writeback activity, i used compilation or multithreaed random
writes via fio. the warning
WARNING: at fs/btrfs/extent-tree.c:7283 btrfs_free_block_groups+0x25b/0x370
appeared within minutes.
david
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Btrfs: release space on error in page_mkwrite
2012-01-11 14:27 ` David Sterba
@ 2012-01-12 11:59 ` David Sterba
0 siblings, 0 replies; 3+ messages in thread
From: David Sterba @ 2012-01-12 11:59 UTC (permalink / raw)
To: David Sterba; +Cc: Josef Bacik, linux-btrfs
On Wed, Jan 11, 2012 at 03:27:09PM +0100, David Sterba wrote:
> On Tue, Jan 10, 2012 at 02:20:18PM -0500, Josef Bacik wrote:
> WARNING: at fs/btrfs/extent-tree.c:7283 btrfs_free_block_groups+0x25b/0x370
>
> appeared within minutes.
Sorry, I spoke too soon, the test was running overnight and the warning
is there. I'll send you updated logs and traces.
david
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-12 11:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-10 19:20 [PATCH] Btrfs: release space on error in page_mkwrite Josef Bacik
2012-01-11 14:27 ` David Sterba
2012-01-12 11:59 ` David Sterba
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).