From: yebin <yebin10@huawei.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: <linux-ide@vger.kernel.org>, <axboe@kernel.dk>,
Paolo Bonzini <pbonzini@redhat.com>
Subject: Re: [PATCH] scsi/libata: Fix usage of page address by page_address in ata_scsi_mode_select_xlat function
Date: Sat, 30 May 2020 14:18:27 +0800 [thread overview]
Message-ID: <5ED1FAB3.6020609@huawei.com> (raw)
In-Reply-To: <20200529124807.GA23222@infradead.org>
On 2020/5/29 20:48, Christoph Hellwig wrote:
> On Fri, May 29, 2020 at 02:32:51PM +0800, Ye Bin wrote:
>> index 435781a16875..d674184ed835 100644
>> --- a/drivers/ata/libata-scsi.c
>> +++ b/drivers/ata/libata-scsi.c
>> @@ -3723,7 +3723,7 @@ static unsigned int ata_scsi_mode_select_xlat(struct ata_queued_cmd *qc)
>> if (!scsi_sg_count(scmd) || scsi_sglist(scmd)->length < len)
>> goto invalid_param_len;
>>
>> - p = page_address(sg_page(scsi_sglist(scmd)));
>> + p = page_address(sg_page(scsi_sglist(scmd))) + scsi_sglist(scmd)->offset;
> This also looks completely buggy on highmem systems and really needs to
> use a kmap_atomic.
> .
Thank you for your reply.
As in sg_scsi_ioctl function allocate bio memory by kzalloc. Maybe
it's better to give
the caller more freedom, and at the same time, it's more robust.
>
prev parent reply other threads:[~2020-05-30 6:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-29 6:32 [PATCH] scsi/libata: Fix usage of page address by page_address in ata_scsi_mode_select_xlat function Ye Bin
2020-05-29 12:48 ` Christoph Hellwig
2020-05-30 5:43 ` Paolo Bonzini
2020-05-30 6:18 ` yebin [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=5ED1FAB3.6020609@huawei.com \
--to=yebin10@huawei.com \
--cc=axboe@kernel.dk \
--cc=hch@infradead.org \
--cc=linux-ide@vger.kernel.org \
--cc=pbonzini@redhat.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).