From: Theodore Ts'o <tytso@mit.edu>
To: Vegard Nossum <vegard.nossum@oracle.com>
Cc: linux-ext4@vger.kernel.org,
"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
Subject: Re: [PATCH] ext4: fix reference counting bug on block allocation error
Date: Thu, 14 Jul 2016 23:01:55 -0400 [thread overview]
Message-ID: <20160715030155.GB26465@thunk.org> (raw)
In-Reply-To: <577E3B53.3070502@oracle.com>
On Thu, Jul 07, 2016 at 01:21:55PM +0200, Vegard Nossum wrote:
>
> The attached new patch just returns on error instead of trying to fix
> the problem.
The issue with your v2 patch is that we end up returning EAGAIN to
userspace, which is confusing. So I've fixed up your patch by adding
the following changes.
Thanks,
- Ted
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 5399b88..1156216 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2943,7 +2943,7 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
ext4_error(sb, "Allocating blocks %llu-%llu which overlap "
"fs metadata", block, block+len);
/* File system mounted not to panic on error
- * Fix the bitmap and repeat the block allocation
+ * Fix the bitmap and return EFSCORRUPTED
* We leak some of the blocks here.
*/
ext4_lock_group(sb, ac->ac_b_ex.fe_group);
@@ -2952,7 +2952,7 @@ ext4_mb_mark_diskspace_used(struct ext4_allocation_context *ac,
ext4_unlock_group(sb, ac->ac_b_ex.fe_group);
err = ext4_handle_dirty_metadata(handle, NULL, bitmap_bh);
if (!err)
- err = -EAGAIN;
+ err = -EFSCORRUPTED;
goto out_err;
}
prev parent reply other threads:[~2016-07-15 3:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-07-06 13:57 [PATCH] ext4: fix reference counting bug on block allocation error Vegard Nossum
2016-07-07 11:21 ` Vegard Nossum
2016-07-15 3:01 ` Theodore Ts'o [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160715030155.GB26465@thunk.org \
--to=tytso@mit.edu \
--cc=aneesh.kumar@linux.vnet.ibm.com \
--cc=linux-ext4@vger.kernel.org \
--cc=vegard.nossum@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).