linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Douglas Gilbert <dgilbert@interlog.com>
To: Hannes Reinecke <hare@suse.de>,
	"Elliott, Robert (Servers)" <elliott@hpe.com>,
	Bart Van Assche <bvanassche@acm.org>,
	Marc Gonzalez <marc.w.gonzalez@free.fr>,
	James Bottomley <jejb@linux.ibm.com>,
	Martin Petersen <martin.petersen@oracle.com>
Cc: SCSI <linux-scsi@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH v1] scsi: Don't select SCSI_PROC_FS by default
Date: Fri, 5 Jul 2019 13:53:12 -0400	[thread overview]
Message-ID: <e2469890-e0ae-fb79-4aa9-125cdaeedb2b@interlog.com> (raw)
In-Reply-To: <1ad3e7ba-008d-31ad-89a0-b118b36e14e2@suse.de>

On 2019-07-05 3:22 a.m., Hannes Reinecke wrote:
> On 6/18/19 7:43 PM, Elliott, Robert (Servers) wrote:
>>
>>
>>> -----Original Message-----
>>> From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-owner@vger.kernel.org] On Behalf Of Bart
>>> Van Assche
>>> Sent: Monday, June 17, 2019 10:28 PM
>>> To: dgilbert@interlog.com; Marc Gonzalez <marc.w.gonzalez@free.fr>; James Bottomley
>>> <jejb@linux.ibm.com>; Martin Petersen <martin.petersen@oracle.com>
>>> Cc: SCSI <linux-scsi@vger.kernel.org>; LKML <linux-kernel@vger.kernel.org>; Christoph Hellwig
>>> <hch@lst.de>
>>> Subject: Re: [PATCH v1] scsi: Don't select SCSI_PROC_FS by default
>>>
>>> On 6/17/19 5:35 PM, Douglas Gilbert wrote:
>>>> For sg3_utils:
>>>>
>>>> $ find . -name '*.c' -exec grep "/proc/scsi" {} \; -print
>>>> static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio";
>>>> ./src/sg_read.c
>>>> static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio";
>>>> ./src/sgp_dd.c
>>>> static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio";
>>>> ./src/sgm_dd.c
>>>> static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio";
>>>> ./src/sg_dd.c
>>>>                   "'echo 1 > /proc/scsi/sg/allow_dio'\n", q_len,
>>>> dirio_count);
>>>> ./testing/sg_tst_bidi.c
>>>> static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio";
>>>> ./examples/sgq_dd.c
>>>>
>>>> That is 6 (not 38) by my count.
>>>
>>> Hi Doug,
>>>
>>> This is the command I ran:
>>>
>>> $ git grep /proc/scsi | wc -l
>>> 38
>>>
>>> I think your query excludes scripts/rescan-scsi-bus.sh.
>>>
>>> Bart.
>>
>> Here's the full list to ensure the discussion doesn't overlook anything:
>>
>> sg3_utils-1.44$ grep -R /proc/scsi .
>> ./src/sg_read.c:static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio";
>> ./src/sgp_dd.c:static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio";
>> ./src/sgm_dd.c:static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio";
>> ./src/sg_dd.c:static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio";
>> ./scripts/rescan-scsi-bus.sh:# Return hosts. /proc/scsi/HOSTADAPTER/? must exist
>> ./scripts/rescan-scsi-bus.sh:  for driverdir in /proc/scsi/*; do
>> ./scripts/rescan-scsi-bus.sh:    driver=${driverdir#/proc/scsi/}
>> ./scripts/rescan-scsi-bus.sh:      name=${hostdir#/proc/scsi/*/}
>> ./scripts/rescan-scsi-bus.sh:# Get /proc/scsi/scsi info for device $host:$channel:$id:$lun
>> ./scripts/rescan-scsi-bus.sh:    SCSISTR=$(grep -A "$LN" -e "$grepstr" /proc/scsi/scsi)
>> ./scripts/rescan-scsi-bus.sh:    DRV=`grep 'Attached drivers:' /proc/scsi/scsi 2>/dev/null`
>> ./scripts/rescan-scsi-bus.sh:      echo "scsi report-devs 1" >/proc/scsi/scsi
>> ./scripts/rescan-scsi-bus.sh:      DRV=`grep 'Attached drivers:' /proc/scsi/scsi 2>/dev/null`
>> ./scripts/rescan-scsi-bus.sh:      echo "scsi report-devs 0" >/proc/scsi/scsi
>> ./scripts/rescan-scsi-bus.sh:# Outputs description from /proc/scsi/scsi (unless arg passed)
>> ./scripts/rescan-scsi-bus.sh:        echo "scsi remove-single-device $devnr" > /proc/scsi/scsi
>> ./scripts/rescan-scsi-bus.sh:          echo "scsi add-single-device $devnr" > /proc/scsi/scsi
>> ./scripts/rescan-scsi-bus.sh:      echo "scsi add-single-device $devnr" > /proc/scsi/scsi
>> ./scripts/rescan-scsi-bus.sh:      echo "scsi add-single-device $devnr" > /proc/scsi/scsi
>> ./scripts/rescan-scsi-bus.sh:      echo "scsi add-single-device $host $channel $id $SCAN_WILD_CARD" > /proc/scsi/scsi
>> ./scripts/rescan-scsi-bus.sh:if test ! -d /sys/class/scsi_host/ -a ! -d /proc/scsi/; then
>> ./ChangeLog:    /proc/scsi/sg/allow_dio is '0'
>> ./ChangeLog:  - change sg_debug to call system("cat /proc/scsi/sg/debug");
>> ./suse/sg3_utils.changes:  * Support systems without /proc/scsi
>> ./examples/sgq_dd.c:static const char * proc_allow_dio = "/proc/scsi/sg/allow_dio";
>> ./doc/sg_read.8:If direct IO is selected and /proc/scsi/sg/allow_dio
>> ./doc/sg_read.8:"echo 1 > /proc/scsi/sg/allow_dio". An alternate way to avoid the
>> ./doc/sg_map.8:observing the output of the command: "cat /proc/scsi/scsi".
>> ./doc/sgp_dd.8:at completion. If direct IO is selected and /proc/scsi/sg/allow_dio
>> ./doc/sgp_dd.8:this at completion. If direct IO is selected and /proc/scsi/sg/allow_dio
>> ./doc/sgp_dd.8:mapping to SCSI block devices should be checked with 'cat /proc/scsi/scsi'
>> ./doc/sg_dd.8:notes this at completion. If direct IO is selected and /proc/scsi/sg/allow_dio
>> ./doc/sg_dd.8:this at completion. If direct IO is selected and /proc/scsi/sg/allow_dio
>> ./doc/sg_dd.8:with 'echo 1 > /proc/scsi/sg/allow_dio'.
>> ./doc/sg_dd.8:mapping to SCSI block devices should be checked with 'cat /proc/scsi/scsi',
>>
>>
> As mentioned, rescan-scsi-bus.sh is keeping references to /proc/scsi as
> a fall back only, as it's meant to work kernel independent. Per default
> it'll be using /sys, and will happily work without /proc/scsi.
> 
> So it's really only /proc/scsi/sg which carries some meaningful
> information; maybe we should move/copy it to somewhere else.
> 
> I personally like getting rid of /proc/scsi.

/proc/scsi/device_info doesn't seem to be in sysfs.

Could the contents of /proc/scsi/sg/* be placed in
/sys/class/scsi_generic/* ? Currently that directory only has symlinks
to the sg devices.

Doug Gilbert

  reply	other threads:[~2019-07-05 17:53 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-12 13:59 [PATCH v1] scsi: Don't select SCSI_PROC_FS by default Marc Gonzalez
2019-06-17 21:11 ` Bart Van Assche
2019-06-18  0:35   ` Douglas Gilbert
2019-06-18  1:08     ` Finn Thain
2019-06-18  7:29       ` Marc Gonzalez
2019-06-18 15:31         ` Douglas Gilbert
2019-06-19  9:42           ` Marc Gonzalez
2019-06-19 14:34             ` Douglas Gilbert
2019-06-20  9:01               ` Marc Gonzalez
2019-06-20 21:47                 ` Martin K. Petersen
2019-06-20 23:43                 ` Finn Thain
2019-06-21 10:41                   ` Marc Gonzalez
2019-06-21 23:50                     ` Finn Thain
2019-06-18  3:28     ` Bart Van Assche
2019-06-18 17:43       ` Elliott, Robert (Servers)
2019-07-05  7:22         ` Hannes Reinecke
2019-07-05 17:53           ` Douglas Gilbert [this message]
2019-07-08  6:01             ` Hannes Reinecke
2019-07-08 13:02               ` Douglas Gilbert
2019-07-05  7:18       ` Hannes Reinecke

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=e2469890-e0ae-fb79-4aa9-125cdaeedb2b@interlog.com \
    --to=dgilbert@interlog.com \
    --cc=bvanassche@acm.org \
    --cc=elliott@hpe.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=jejb@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=marc.w.gonzalez@free.fr \
    --cc=martin.petersen@oracle.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).