From: Jan Kara <jack@suse.cz>
To: Dmitry Monakhov <dmonakhov@openvz.org>
Cc: linux-ext4@vger.kernel.org, Jan Kara <jack@suse.cz>, cmm@us.ibm.com
Subject: Re: [PATCH] ext4: fix sleep inside spinlock issue aka #14739 V2
Date: Tue, 15 Dec 2009 22:48:06 +0100 [thread overview]
Message-ID: <20091215214806.GD9554@quack.suse.cz> (raw)
In-Reply-To: <87bpi6zquv.fsf_-_@openvz.org>
On Thu 10-12-09 20:22:16, Dmitry Monakhov wrote:
>
> drop i_block_reservation_lock before vfs_dq_reserve_block().
> this patch fix http://bugzilla.kernel.org/show_bug.cgi?id=14739
>
> changes from previous version:
> - simplify the patch according to Jan's comments
Dmitry, I suppose I should also merge this patch together with your other
fixes, right? For some reason, it was not part of the last submission of
your patch series...
Honza
> Signed-off-by: Dmitry Monakhov <dmonakhov@openvz.org>
> ---
> fs/ext4/inode.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 942e183..2327f7a 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -1851,6 +1851,7 @@ repeat:
>
> md_needed = mdblocks - EXT4_I(inode)->i_reserved_meta_blocks;
> total = md_needed + nrblocks;
> + spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
>
> /*
> * Make quota reservation here to prevent quota overflow
> @@ -1858,12 +1859,10 @@ repeat:
> * time.
> */
> if (vfs_dq_reserve_block(inode, total)) {
> - spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
> return -EDQUOT;
> }
>
> if (ext4_claim_free_blocks(sbi, total)) {
> - spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
> vfs_dq_release_reservation_block(inode, total);
> if (ext4_should_retry_alloc(inode->i_sb, &retries)) {
> yield();
> @@ -1871,10 +1870,11 @@ repeat:
> }
> return -ENOSPC;
> }
> + spin_lock(&EXT4_I(inode)->i_block_reservation_lock);
> EXT4_I(inode)->i_reserved_data_blocks += nrblocks;
> EXT4_I(inode)->i_reserved_meta_blocks = mdblocks;
> -
> spin_unlock(&EXT4_I(inode)->i_block_reservation_lock);
> +
> return 0; /* success */
> }
>
> --
> 1.6.0.4
>
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2009-12-15 21:48 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-10 1:42 [PATCH] ext4: fix sleep inside spinlock issue aka #14739 Dmitry Monakhov
2009-12-10 16:15 ` Jan Kara
2009-12-10 17:22 ` [PATCH] ext4: fix sleep inside spinlock issue aka #14739 V2 Dmitry Monakhov
2009-12-15 21:48 ` Jan Kara [this message]
2009-12-15 23:16 ` Dmitry Monakhov
2009-12-15 23:44 ` Jan Kara
2009-12-18 10:06 ` Aneesh Kumar K.V
2009-12-19 15:11 ` Dmitry Monakhov
2009-12-18 10:02 ` [PATCH] ext4: fix sleep inside spinlock issue aka #14739 Aneesh Kumar K.V
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=20091215214806.GD9554@quack.suse.cz \
--to=jack@suse.cz \
--cc=cmm@us.ibm.com \
--cc=dmonakhov@openvz.org \
--cc=linux-ext4@vger.kernel.org \
/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).