All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Yan <tom.ty89@gmail.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-scsi@vger.kernel.org, dgilbert@interlog.com,
	Bart Van Assche <bvanassche@acm.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	akinobu.mita@gmail.com, linux-api@vger.kernel.org
Subject: Re: [PATCH RESEND 2/4] scsi: sg: implement BLKSSZGET
Date: Thu, 10 Sep 2020 09:59:05 +0800	[thread overview]
Message-ID: <CAGnHSE=ASs3DG2yp1NpODHimwxHe+=XPRsOyDdkB3ThtyEU-KA@mail.gmail.com> (raw)
In-Reply-To: <20200908084258.GA17030@lst.de>

If we rename it to e.g. SG_GET_MAX_XFER_BYTES, it will still break
applications unless we also keep the wrong/ugly/confusing name (and
you lose the advantage/generality that the two ioctls can be used on
both sg and "pure" block devices; which seems to be the case of some
SG_* ioctls as well).

I don't see what it has to do with passthrough. Either way, it's just
a matter of whether you want to decouple it and make things more
flexible. The only real disadvantage is, you will have to do two
ioctls instead of one, but no more than that, and for good reasons.

I don't really care enough though. I mean, I'm okay with
SG_GET_MAX_XFER_BYTES *and* NO "improper" BLKSECTGET. If that will get
the patch series in, I am willing to send a new version. If not, I'm
just gonna drop this.

On Tue, 8 Sep 2020 at 16:43, Christoph Hellwig <hch@lst.de> wrote:
>
> On Mon, Sep 07, 2020 at 05:01:34PM +0800, Tom Yan wrote:
> > Feel free to omit this. But then you will probably want to ditch
> > BLKSECTGET as well, and then any usage of queue_max_sectors(), and
> > maybe more/all queue_*().
> >
> > I'm not really interested in discussing/arguing whether
> > general/ideally-speaking it's appropriate/necessary to keep BLKSECTGET
> > / add BLKSSZGET. The only reason I added this is that, when BLKSECTGET
> > was introduced to sg long time ago, it was wrongly implemented to
> > gives out the limit in bytes, so now when I'm fixing it, I'm merely
> > making sure that whatever has been relying on the ioctl (e.g. qemu)
> > will only need to do one more ioctl (instead of e.g. doing SCSI in its
> > non-SCSI-specific part), if they want/need the limit in bytes. If they
> > can be implemented more "generic"-ly, feel free to improve/extend them
> > to make them "SG_*-qualified".
> >
> > Even if you can do SCSI from the userspace, or even should, I don't
> > see any reason that we shouldn't provide an ioctl to do
> > queue_logical_block_size() *while we provide one to do
> > queue_max_sectors()*.
>
> Well, the different definition in bytes for sg actually makes sense
> to me, as a bytes based limit is what fundamentally makes sense for
> the passthrough interface.  Only that it reuses the same cmd value
> is a bit confusing.  So instead of changing anything and potentially
> breaking applications I'd suggest to just better document the semantics.

  reply	other threads:[~2020-09-10  2:48 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-04  4:42 About BLKSECTGET in sg Tom Yan
2020-09-04 16:28 ` Douglas Gilbert
2020-09-04 19:21   ` Tom Yan
2020-09-04 20:05     ` [PATCH 1/4] scsi: sg: fix BLKSECTGET ioctl Tom Yan
2020-09-04 20:05       ` [PATCH 2/4] scsi: sg: implement BLKSSZGET Tom Yan
2020-09-05 18:37         ` Douglas Gilbert
2020-09-04 20:05       ` [PATCH 3/4] scsi: sg: use queue_logical_sector_size() in max_sectors_bytes() Tom Yan
2020-09-05 18:37         ` Douglas Gilbert
2020-09-04 20:05       ` [PATCH 4/4] block/scsi_ioctl.c: " Tom Yan
2020-09-05 18:37         ` Douglas Gilbert
2020-09-05 18:37       ` [PATCH 1/4] scsi: sg: fix BLKSECTGET ioctl Douglas Gilbert
2020-09-05 19:32       ` Bart Van Assche
2020-09-05 20:36         ` Douglas Gilbert
2020-09-06  1:19           ` Tom Yan
2020-09-06  1:25             ` [PATCH RESEND " Tom Yan
2020-09-06  1:25               ` [PATCH RESEND 2/4] scsi: sg: implement BLKSSZGET Tom Yan
2020-09-06  1:25               ` [PATCH RESEND 3/4] scsi: sg: use queue_logical_sector_size() in max_sectors_bytes() Tom Yan
2020-09-06  1:25               ` [PATCH RESEND 4/4] block/scsi_ioctl.c: " Tom Yan
2020-09-06  1:27             ` [PATCH RESEND 1/4] scsi: sg: fix BLKSECTGET ioctl Tom Yan
2020-09-06  1:27               ` [PATCH RESEND 2/4] scsi: sg: implement BLKSSZGET Tom Yan
2020-09-07  6:09                 ` Christoph Hellwig
2020-09-07  9:01                   ` Tom Yan
2020-09-08  8:42                     ` Christoph Hellwig
2020-09-10  1:59                       ` Tom Yan [this message]
2020-09-10  5:28                         ` Christoph Hellwig
2020-09-11  2:52                           ` Tom Yan
2020-09-11  6:48                             ` Christoph Hellwig
2020-09-11 17:52                               ` Douglas Gilbert
2020-09-11 21:33                                 ` Alan Stern
2020-09-16  5:47                               ` Tom Yan
2020-09-06  1:27               ` [PATCH RESEND 3/4] scsi: sg: use queue_logical_sector_size() in max_sectors_bytes() Tom Yan
2020-09-06  6:26                 ` Greg KH
2020-09-06  7:01                   ` Tom Yan
2020-09-06  7:40                     ` [PATCH v2 1/4] scsi: sg: fix BLKSECTGET ioctl Tom Yan
2020-09-06  7:40                       ` [PATCH v2 2/4] scsi: sg: implement BLKSSZGET Tom Yan
2020-09-06  7:40                       ` [PATCH v2 3/4] scsi: sg: use queue_logical_sector_size() in max_sectors_bytes() Tom Yan
2020-09-06  7:40                       ` [PATCH v2 4/4] block/scsi_ioctl.c: " Tom Yan
2020-09-06  7:51                     ` [PATCH v3 1/4] scsi: sg: fix BLKSECTGET ioctl Tom Yan
2020-09-06  7:51                       ` [PATCH v3 2/4] scsi: sg: implement BLKSSZGET Tom Yan
2020-09-06  7:51                       ` [PATCH v3 3/4] scsi: sg: use queue_logical_sector_size() in max_sectors_bytes() Tom Yan
2020-09-06  7:51                       ` [PATCH v3 4/4] block/scsi_ioctl.c: " Tom Yan
2020-09-06  1:27               ` [PATCH RESEND " Tom Yan
2020-09-06  5:09             ` [PATCH 1/4] scsi: sg: fix BLKSECTGET ioctl Douglas Gilbert
2020-09-06  7:16               ` Tom Yan

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='CAGnHSE=ASs3DG2yp1NpODHimwxHe+=XPRsOyDdkB3ThtyEU-KA@mail.gmail.com' \
    --to=tom.ty89@gmail.com \
    --cc=akinobu.mita@gmail.com \
    --cc=bvanassche@acm.org \
    --cc=dgilbert@interlog.com \
    --cc=hch@lst.de \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.