[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4EB8ECD64F601331+e2f01a1f-8da5-4e7b-b909-d920a792756a@uniontech.com>
Date: Wed, 26 Feb 2025 10:31:36 +0800
From: WangYuli <wangyuli@...ontech.com>
To: Bart Van Assche <bvanassche@....org>,
James.Bottomley@...senPartnership.com, martin.petersen@...cle.com,
Alan Stern <stern@...land.harvard.edu>
Cc: linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org,
stern@...land.harvard.edu, zhanjun@...ontech.com, niecheng1@...ontech.com,
guanwentao@...ontech.com, chenlinxuan@...ontech.com,
Xinwei Zhou <zhouxinwei@...ontech.com>, Xu Rao <raoxu@...ontech.com>,
Yujing Ming <mingyujing@...ontech.com>
Subject: Re: [RESEND PATCH v3] scsi: Bypass certain SCSI commands on disks
with "use_192_bytes_for_3f" attribute
Hi Bart,
On 2025/2/26 04:54, Bart Van Assche wrote:
>
> Has it been considered to truncate the MODE SENSE buffer to 192 bytes
> instead of rejecting the MODE SENSE command?
>
>
Alan Stern has raised a related issue before. My take on this is
outlined below.
I personally think that it is not appropriate to modify it directly
to 192. After all, it is called by the user through ioctl, and the
kernel itself will not construct such a data frame. As shown in the
following code:
sd_read_write_protect_flag(struct scsi_disk *sdkp, unsigned char *buffer)
{
int res;
struct scsi_device *sdp = sdkp->device;
struct scsi_mode_data data;
int old_wp = sdkp->write_prot;
set_disk_ro(sdkp->disk, 0);
if (sdp->skip_ms_page_3f) {
sd_first_printk(KERN_NOTICE, sdkp, "Assuming Write Enabled\n");
return;
}
if (sdp->use_192_bytes_for_3f) {
res = sd_do_mode_sense(sdp, 0, 0x3F, buffer, 192, &data, NULL);
Link:
https://lore.kernel.org/all/137902FEE03CCB3B+6130227f-9ddc-4043-9945-da465c28d9d1@uniontech.com/
--
WangYuli
Download attachment "OpenPGP_0xC5DA1F3046F40BEE.asc" of type "application/pgp-keys" (633 bytes)
Download attachment "OpenPGP_signature.asc" of type "application/pgp-signature" (237 bytes)
Powered by blists - more mailing lists