linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wang Sheng-Hui <shhuiw@gmail.com>
To: bo.li.liu@oracle.com
Cc: chris.mason@fusionio.com, jbacik@fusionio.com,
	linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: remove warning check in io_ctl_map_page
Date: Fri, 30 Nov 2012 19:18:21 +0800	[thread overview]
Message-ID: <50B895FD.80006@gmail.com> (raw)
In-Reply-To: <20121130090252.GA7353@liubo.cn.oracle.com>

On 2012年11月30日 17:02, Liu Bo wrote:

> On Fri, Nov 30, 2012 at 02:02:26PM +0800, shhuiw@gmail.com wrote:
>> From: Wang Sheng-Hui <shhuiw@gmail.com>
>>
>> io_ctl_map_page is called by many functions in free-space-cache.
>> In some scenarios, the ->cur is not null, e.g. io_ctl_add_entry.
>> Remove the check here.
> 
> Hi Wang,
> 
> Seems to be impossible according to the code, even in io_ctl_add_entry().
> 
> So have you seen such a warning in your flight running?  If you do,
> maybe you can post it here and we can figure out the whys.
> 


Hi Liu Bo,

I just walked through the code. reread io_ctl_add_entry, and just noticed
that io_ctl_set_crc is called before io_ctl_map_page, which can guarantee
the ->cur is set to null before map.

Thanks for helping me understand the code.

Regards,
Sheng-Hui


> thanks,
> liubo
> 
>>
>> Signed-off-by: Wang Sheng-Hui <shhuiw@gmail.com>
>> ---
>>  fs/btrfs/free-space-cache.c |    1 -
>>  1 files changed, 0 insertions(+), 1 deletions(-)
>>
>> diff --git a/fs/btrfs/free-space-cache.c b/fs/btrfs/free-space-cache.c
>> index c3318cb..4ea66d4 100644
>> --- a/fs/btrfs/free-space-cache.c
>> +++ b/fs/btrfs/free-space-cache.c
>> @@ -307,7 +307,6 @@ static void io_ctl_unmap_page(struct io_ctl *io_ctl)
>>  
>>  static void io_ctl_map_page(struct io_ctl *io_ctl, int clear)
>>  {
>> -	WARN_ON(io_ctl->cur);
>>  	BUG_ON(io_ctl->index >= io_ctl->num_pages);
>>  	io_ctl->page = io_ctl->pages[io_ctl->index++];
>>  	io_ctl->cur = kmap(io_ctl->page);
>> -- 
>> 1.6.0.2
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html



  reply	other threads:[~2012-11-30 11:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1354255348-5011-1-git-send-email-y>
2012-11-30  6:02 ` [PATCH] Btrfs: remove warning check in io_ctl_map_page shhuiw
2012-11-30  9:02   ` Liu Bo
2012-11-30 11:18     ` Wang Sheng-Hui [this message]
2012-11-30  6:02 ` [PATCH] Btrfs: check crc area early in io_ctl_init shhuiw
2012-11-30  6:02 ` [PATCH] Btrfs: cleanup: assign path->nodes[0]to leaf after ret check in __btrfs_write_out_cache shhuiw

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=50B895FD.80006@gmail.com \
    --to=shhuiw@gmail.com \
    --cc=bo.li.liu@oracle.com \
    --cc=chris.mason@fusionio.com \
    --cc=jbacik@fusionio.com \
    --cc=linux-btrfs@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).