linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Anatol Pomozov <anatol.pomozov@gmail.com>
Cc: wenqing.lz@taobao.com, linux-ext4@vger.kernel.org
Subject: Re: [PATCH 2/2] ext4: Remove code duplication in ext4_get_block_write_nolock()
Date: Fri, 9 Nov 2012 12:29:57 -0500	[thread overview]
Message-ID: <20121109172957.GA19041@thunk.org> (raw)
In-Reply-To: <1350328009-22740-2-git-send-email-anatol.pomozov@gmail.com>

There's a really serious bug in this patch which I didn't notice at
first:

> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -683,7 +683,7 @@ static int _ext4_get_block(struct inode *inode, sector_t iblock,
>  	map.m_lblk = iblock;
>  	map.m_len = bh->b_size >> inode->i_blkbits;
>  
> -	if (flags && !handle) {
> +	if (flags && !(flags | EXT4_GET_BLOCKS_NO_LOCK) && !handle) {
                            ^^^

This should obviously read:

	if (flags && !(flags & EXT4_GET_BLOCKS_NO_LOCK) && !handle) {

Otherwise xfstests #91 will blow out with a circular lockdep warning.

As a reminder, please do make sure you compile with lockdep enabled
when you run your tests; it's found more than one bug for me!

     	     	  	      	    	      - Ted

  parent reply	other threads:[~2012-11-09 17:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-15 19:06 [PATCH 1/2] Use 'inode' variable that is already dereferenced Anatol Pomozov
2012-10-15 19:06 ` [PATCH 2/2] ext4: Remove code duplication in ext4_get_block_write_nolock() Anatol Pomozov
2012-10-15 19:14   ` Anatol Pomozov
2012-10-16  2:37     ` Zheng Liu
2012-10-16  2:36   ` Zheng Liu
2012-11-08 20:08   ` Theodore Ts'o
2012-11-09 17:29   ` Theodore Ts'o [this message]
2012-11-09 17:51     ` Anatol Pomozov
2012-10-16  2:28 ` [PATCH 1/2] Use 'inode' variable that is already dereferenced Zheng Liu

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=20121109172957.GA19041@thunk.org \
    --to=tytso@mit.edu \
    --cc=anatol.pomozov@gmail.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=wenqing.lz@taobao.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).