Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3636414ybi; Fri, 5 Jul 2019 10:54:50 -0700 (PDT) X-Google-Smtp-Source: APXvYqyqZblT4NM/0dhcxUpQIDE+D2YFkrht8/1yP0S4CmdlbUqq1yFxLIopTtXBm3SXaEq5ATLG X-Received: by 2002:a63:e70f:: with SMTP id b15mr2300396pgi.152.1562349290074; Fri, 05 Jul 2019 10:54:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562349290; cv=none; d=google.com; s=arc-20160816; b=cDrWv6cMtXpAMlDIsdVnAZ3sLM8BGPH3GFdx55LLEjRrBWLFnkSLrwNalsUXf3TuqI iSIc7Yfx09th/9GPlKQyC+gMcd5YeXQ62ruDFO5qvxcXu2BbH/3DT+m2OI9eat3D6uTD P21P8OhfUKZIepYwLsUyDZ6hh4rqU4Jd8DEJ12nsH/m8clukaUxVYhSyv+AFGxGGZk23 jw21YCzkt1tyT1AuzRfJP6R+vfmt6OxdGjqVIFxT0YyQ0XHmLJFYoT9fTlWcDYfQE08R GLGjXlAREkWaUohwyJXNgli6kDGY9pN1JzM22CUxDs7yDcA/DGFPfpdG0T4evCOInr2I AmnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:reply-to; bh=gEXgrLQyvJC8xgLiV4/DLjMtDQ7xjlV7G5U+S716D1A=; b=SYgTOYbFVucdE04iEvycqhTFBili38zbNcKDs2IdPT4nVGIlHeWbm1v2mnXT1GMQ1a WfzgFxhlsnlXLs7fcG1HJMBFt0EjgsbbB5hBm3s5BFD9NBqrzS/Kq5rT/7RsBCiETXTr 85BiTtFykgXSO0M6kEW7i6L4UknxR4Y4f4SDjZ6hBfIyHuEnTWAY0SFdlajR6KtVTwsT +2knV73Iw0vDTDawRUrWRGmDu9f4Awu4a8/yhHxWUV+8YVnyfyAQqyGaSaL/4/y2kLsI aZB++GYmxNQ/7KjogkrxJeDgIzMNiPXNDN1KgywxG2zm3uHkr+33JgFASJsMgHIpAwRT OkzQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b14si9616948pgi.434.2019.07.05.10.54.35; Fri, 05 Jul 2019 10:54:50 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727341AbfGERx1 (ORCPT + 99 others); Fri, 5 Jul 2019 13:53:27 -0400 Received: from smtp.infotech.no ([82.134.31.41]:56627 "EHLO smtp.infotech.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726743AbfGERx1 (ORCPT ); Fri, 5 Jul 2019 13:53:27 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp.infotech.no (Postfix) with ESMTP id E4702204199; Fri, 5 Jul 2019 19:53:23 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.6 (20110518) (Debian) at infotech.no Received: from smtp.infotech.no ([127.0.0.1]) by localhost (smtp.infotech.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ISHY-xOxtrmM; Fri, 5 Jul 2019 19:53:17 +0200 (CEST) Received: from [192.168.48.23] (host-23-251-188-50.dyn.295.ca [23.251.188.50]) by smtp.infotech.no (Postfix) with ESMTPA id 6983E204145; Fri, 5 Jul 2019 19:53:15 +0200 (CEST) Reply-To: dgilbert@interlog.com Subject: Re: [PATCH v1] scsi: Don't select SCSI_PROC_FS by default To: Hannes Reinecke , "Elliott, Robert (Servers)" , Bart Van Assche , Marc Gonzalez , James Bottomley , Martin Petersen Cc: SCSI , LKML , Christoph Hellwig References: <2de15293-b9be-4d41-bc67-a69417f27f7a@free.fr> <621306ee-7ab6-9cd2-e934-94b3d6d731fc@acm.org> <1ad3e7ba-008d-31ad-89a0-b118b36e14e2@suse.de> From: Douglas Gilbert Message-ID: Date: Fri, 5 Jul 2019 13:53:12 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <1ad3e7ba-008d-31ad-89a0-b118b36e14e2@suse.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 ; James Bottomley >>> ; Martin Petersen >>> Cc: SCSI ; LKML ; Christoph Hellwig >>> >>> 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