linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tao Ma <tm@tao.ma>
To: Ted Ts'o <tytso@mit.edu>
Cc: linux-ext4@vger.kernel.org, sandeen@redhat.com
Subject: Re: [PATCH] ext4: Resolve the hang of direct i/o read in handling EXT4_IO_END_UNWRITTEN.
Date: Wed, 17 Aug 2011 10:32:16 +0800	[thread overview]
Message-ID: <4E4B2830.202@tao.ma> (raw)
In-Reply-To: <20110816182922.GA12374@thunk.org>

On 08/17/2011 02:29 AM, Ted Ts'o wrote:
> On Tue, Aug 16, 2011 at 02:37:53PM +0800, Tao Ma wrote:
>> From: Tao Ma <boyu.mt@taobao.com>
>>
>> EXT4_IO_END_UNWRITTEN flag set and the increase of i_aiodio_unwritten should
>> be done simultaneously since ext4_end_io_nolock always clear the flag and
>> decrease the counter in the same time.
>>
>> We don't increase i_aiodio_unwritten when setting EXT4_IO_END_UNWRITTEN so
>> it will go nagative and causes some process to wait forever.
>>
>> Part of the patch came from Eric in his e-mail, but it doesn't fix the problem
>> met by Michael actually.
>> http://marc.info/?l=linux-ext4&m=131316851417460&w=2
>>
>> Reported-and-Tested-by: Michael Tokarev<mjt@tls.msk.ru>
>> Signed-off-by: Eric Sandeen <sandeen@redhat.com>
>> Signed-off-by: Tao Ma <boyu.mt@taobao.com>
> 
> Thanks I've taken this into the ext4 tree.  I am a bit worried this
> will trigger a GCC warning:
> 
> +	/*
> +	 * It may be over-defensive here to check EXT4_IO_END_UNWRITTEN now,
> +	 * but being more careful is always safe for the future change.
> +	 */
>  	inode = io_end->inode;
> +	if (!(io_end->flag & EXT4_IO_END_UNWRITTEN)) {
> +		io_end->flag |= EXT4_IO_END_UNWRITTEN;
> +		atomic_inc(&EXT4_I(inode)->i_aiodio_unwritten);
> +	}
>  
>  	/* Add the io_end to per-inode completed io list*/
>  	spin_lock_irqsave(&EXT4_I(inode)->i_completed_io_lock, flags);
> 
> ... since in Google we've been compiling with -Werror, but it's not
> causing an error on gcc 4.4, which is what I still have on my laptop.
> It may be that newer versions of GCC are smart enough to notice tha
> the above is dead code, and then complain with a warning.
Sorry for my bluntness. But where is the 'dead code' you mean?

Thanks
Tao

      reply	other threads:[~2011-08-17  2:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-16  6:37 [PATCH] ext4: Resolve the hang of direct i/o read in handling EXT4_IO_END_UNWRITTEN Tao Ma
2011-08-16 14:06 ` Eric Sandeen
2011-08-16 18:29 ` Ted Ts'o
2011-08-17  2:32   ` Tao Ma [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=4E4B2830.202@tao.ma \
    --to=tm@tao.ma \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=tytso@mit.edu \
    /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).