public inbox for linux-block@vger.kernel.org
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <chaitanyak@nvidia.com>
To: "linan666@huaweicloud.com" <linan666@huaweicloud.com>
Cc: "linux-block@vger.kernel.org" <linux-block@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"hch@lst.de" <hch@lst.de>,
	"yukuai3@huawei.com" <yukuai3@huawei.com>,
	"yi.zhang@huawei.com" <yi.zhang@huawei.com>,
	"houtao1@huawei.com" <houtao1@huawei.com>,
	"yangerkun@huawei.com" <yangerkun@huawei.com>,
	"axboe@kernel.dk" <axboe@kernel.dk>
Subject: Re: [PATCH] block: clean up the check in blkdev_iomap_begin()
Date: Thu, 27 Jun 2024 03:44:02 +0000	[thread overview]
Message-ID: <e629ae7f-509e-4cab-b069-54e889bd8cd0@nvidia.com> (raw)
In-Reply-To: <20240625115517.1472120-1-linan666@huaweicloud.com>

On 6/25/24 04:55, linan666@huaweicloud.com wrote:
> From: Li Nan<linan122@huawei.com>
>
> It is odd to check the offset amidst a series of assignments. Moving this
> check to the beginning of the function makes the code look better.
>
> Signed-off-by: Li Nan<linan122@huawei.com>

it is always better to wait for assignments after all the error checks.

I believe you have verified all the callers and make sure none of the
callers rely on these assignments when this function returns -EIO and
this change will not result in change of behavior, if that is the
case :-

Looks good.

Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>

-ck



  reply	other threads:[~2024-06-27  3:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-25 11:55 [PATCH] block: clean up the check in blkdev_iomap_begin() linan666
2024-06-27  3:44 ` Chaitanya Kulkarni [this message]
2024-06-27  4:54 ` Christoph Hellwig
2024-06-27 15:55 ` Jens Axboe

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=e629ae7f-509e-4cab-b069-54e889bd8cd0@nvidia.com \
    --to=chaitanyak@nvidia.com \
    --cc=axboe@kernel.dk \
    --cc=hch@lst.de \
    --cc=houtao1@huawei.com \
    --cc=linan666@huaweicloud.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.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