From: Theodore Ts'o <tytso@mit.edu>
To: Eric Sandeen <sandeen@redhat.com>
Cc: Ext4 Developers List <linux-ext4@vger.kernel.org>,
stable@vger.kernel.org
Subject: Re: [PATCH] ext4: fix potential deadlock in ext4_nonda_switch()
Date: Fri, 21 Sep 2012 19:59:12 -0400 [thread overview]
Message-ID: <20120921235912.GA27207@thunk.org> (raw)
In-Reply-To: <505CE635.6060101@redhat.com>
On Fri, Sep 21, 2012 at 05:12:05PM -0500, Eric Sandeen wrote:
> > - if (free_blocks < 2 * dirty_blocks)
> > - writeback_inodes_sb_if_idle(sb, WB_REASON_FS_FREE_SPACE);
> > + if ((free_blocks < 2 * dirty_blocks) && writeback_in_progress(sb->s_bdi))
> > + writeback_inodes_sb(sb, WB_REASON_FS_FREE_SPACE);
>
> Looks to me like this inverts the logic.
>
> We used to write back if idle, now we fire it off if it's already underway.
>
> Shouldn't it be:
>
> + if ((free_blocks < 2 * dirty_blocks) && !writeback_in_progress(sb->s_bdi))
> + writeback_inodes_sb(sb, WB_REASON_FS_FREE_SPACE);
Oops, nice catch. Thanks for the review!!
I've added the missing '!' to the patch.
- Ted
next prev parent reply other threads:[~2012-09-21 23:59 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-20 3:23 [PATCH] ext4: fix potential deadlock in ext4_nonda_switch() Theodore Ts'o
2012-09-21 22:12 ` Eric Sandeen
2012-09-21 23:59 ` Theodore Ts'o [this message]
2012-09-27 17:18 ` Dmitry Monakhov
2012-09-27 18:09 ` Theodore Ts'o
2012-09-27 18:16 ` Dmitry Monakhov
2012-09-27 20:14 ` Theodore Ts'o
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=20120921235912.GA27207@thunk.org \
--to=tytso@mit.edu \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=stable@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).