linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yunfeng Ye <yeyunfeng@huawei.com>
To: Omar Sandoval <osandov@osandov.com>
Cc: <clm@fb.com>, <josef@toxicpanda.com>, <dsterba@suse.com>,
	<linux-btrfs@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	"hushiyuan@huawei.com" <hushiyuan@huawei.com>,
	"linfeilong@huawei.com" <linfeilong@huawei.com>
Subject: Re: [PATCH] btrfs: remove unused condition check in btrfs_page_mkwrite()
Date: Tue, 3 Dec 2019 16:33:33 +0800	[thread overview]
Message-ID: <4796f90f-ca5d-7b7c-5645-034af21d7c8b@huawei.com> (raw)
In-Reply-To: <20191203082426.GC829117@vader>



On 2019/12/3 16:24, Omar Sandoval wrote:
> On Tue, Dec 03, 2019 at 04:16:43PM +0800, Yunfeng Ye wrote:
>> The condition '!ret2' is always true. so remove the unused condition
>> check.
>>
>> Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
> 
> For this sort of change, one should mention how the code got in this
> state. In this case, commit 717beb96d969 ("Btrfs: fix regression in
> btrfs_page_mkwrite() from vm_fault_t conversion") left behind the check
> after moving this code out of the goto.
> 
ok, I will update the comment, thanks.

> Ohter than that,
> 
> Reviewed-by: Omar Sandoval <osandov@fb.com>
> 
>> ---
>>  fs/btrfs/inode.c | 11 ++++-------
>>  1 file changed, 4 insertions(+), 7 deletions(-)
>>
>> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
>> index 56032c518b26..eef2432597e2 100644
>> --- a/fs/btrfs/inode.c
>> +++ b/fs/btrfs/inode.c
>> @@ -9073,7 +9073,6 @@ vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf)
>>  		ret = VM_FAULT_SIGBUS;
>>  		goto out_unlock;
>>  	}
>> -	ret2 = 0;
>>
>>  	/* page is wholly or partially inside EOF */
>>  	if (page_start + PAGE_SIZE > size)
>> @@ -9097,12 +9096,10 @@ vm_fault_t btrfs_page_mkwrite(struct vm_fault *vmf)
>>
>>  	unlock_extent_cached(io_tree, page_start, page_end, &cached_state);
>>
>> -	if (!ret2) {
>> -		btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE);
>> -		sb_end_pagefault(inode->i_sb);
>> -		extent_changeset_free(data_reserved);
>> -		return VM_FAULT_LOCKED;
>> -	}
>> +	btrfs_delalloc_release_extents(BTRFS_I(inode), PAGE_SIZE);
>> +	sb_end_pagefault(inode->i_sb);
>> +	extent_changeset_free(data_reserved);
>> +	return VM_FAULT_LOCKED;
>>
>>  out_unlock:
>>  	unlock_page(page);
>> -- 
>> 2.7.4
>>
> 
> .
> 


      reply	other threads:[~2019-12-03  8:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-03  8:16 [PATCH] btrfs: remove unused condition check in btrfs_page_mkwrite() Yunfeng Ye
2019-12-03  8:24 ` Omar Sandoval
2019-12-03  8:33   ` Yunfeng Ye [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=4796f90f-ca5d-7b7c-5645-034af21d7c8b@huawei.com \
    --to=yeyunfeng@huawei.com \
    --cc=clm@fb.com \
    --cc=dsterba@suse.com \
    --cc=hushiyuan@huawei.com \
    --cc=josef@toxicpanda.com \
    --cc=linfeilong@huawei.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=osandov@osandov.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).