Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp3916463ybi; Tue, 18 Jun 2019 08:32:35 -0700 (PDT) X-Google-Smtp-Source: APXvYqynKDYQ/bGoB608CTpm2/Y9uJC1Sr43jJhiz/2QqcgpLvR4rJ1kW2sPJZT9bd+wvkRPyBWg X-Received: by 2002:a63:d551:: with SMTP id v17mr3279440pgi.365.1560871955457; Tue, 18 Jun 2019 08:32:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560871955; cv=none; d=google.com; s=arc-20160816; b=yxUM+U4vJctiBRKUtnOhPSRV8ukJoMP80+9XfRoIyMV+LahCAFs/2mqADtR6kPaNDD pfxxil+d35syvqL0qJqseW72+58Go7J2ZvLBCU4hLpCe4FU4qAos6O1kTaroly/LTX10 QzvAGLyOb2Xv9XSlvvxk3o/InD5CiqX5mxh10kajUI+qUWnOy11Bx1qfNQ2+hoYkZNML q91yzjOkYRhxOjLKTLsMtzxBU9uDkfKBa6dZFZ+ktJespMVIsAeS4VKJsCPn1G+TxQ7f sbted3mm1/evu8LJRCztT80NjJLZSZI+UY7dxHng69ZIqjjOBn6z0mj3S78uif7fpIqV I4YQ== 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=l7W8fhrCsiTuMUcy/ovPzJwUvemkdgv6TFf4phuX8ro=; b=yJRZ7arEstqxlE17Dltd4r4HB+gYHnYl0nHwmXKzaVrzR/rUS1NO7la8dSjsSNIjyL u3OArfzEJJrRHOjyHhTHd9EYn3wLjDHqFXnCxHYkWC8cI1dKxRBR3pdFIlL8sZNKh3j6 3Qb1p5whCDruz2eRtvH2N1ag/3Y/Iuftud6isaHHl63Z3Q9MQ/7EEuB5/v5WzmKpr+PB gvd5NyNBQVWFDeb0j4JvKYaJq8b4Jk9xstg8PbzDOTTVy2XoC7OOHpN2fN5kehGdGk0N tJGkfFXAP7UEDuWb2TG5/J3wNYvAO6RhyEo0hRiuDJwfRDxVaoRDIXKb0MoOtsOdcGNA uQdw== 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 i3si443536pgs.317.2019.06.18.08.32.19; Tue, 18 Jun 2019 08:32:35 -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 S1729776AbfFRPb5 (ORCPT + 99 others); Tue, 18 Jun 2019 11:31:57 -0400 Received: from smtp.infotech.no ([82.134.31.41]:46540 "EHLO smtp.infotech.no" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729189AbfFRPb4 (ORCPT ); Tue, 18 Jun 2019 11:31:56 -0400 Received: from localhost (localhost [127.0.0.1]) by smtp.infotech.no (Postfix) with ESMTP id 9EDDE2041C0; Tue, 18 Jun 2019 17:31:53 +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 pL-vL3TFSVtp; Tue, 18 Jun 2019 17:31:46 +0200 (CEST) Received: from [192.168.48.23] (host-45-58-224-183.dyn.295.ca [45.58.224.183]) by smtp.infotech.no (Postfix) with ESMTPA id B8CE4204150; Tue, 18 Jun 2019 17:31:44 +0200 (CEST) Reply-To: dgilbert@interlog.com Subject: Re: [PATCH v1] scsi: Don't select SCSI_PROC_FS by default To: Marc Gonzalez , Finn Thain Cc: Bart Van Assche , James Bottomley , Martin Petersen , SCSI , LKML , Christoph Hellwig References: <2de15293-b9be-4d41-bc67-a69417f27f7a@free.fr> <621306ee-7ab6-9cd2-e934-94b3d6d731fc@acm.org> <017cf3cf-ecd8-19c2-3bbd-7e7c28042c3c@free.fr> From: Douglas Gilbert Message-ID: Date: Tue, 18 Jun 2019 11:31:42 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 In-Reply-To: <017cf3cf-ecd8-19c2-3bbd-7e7c28042c3c@free.fr> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-CA Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2019-06-18 3:29 a.m., Marc Gonzalez wrote: > On 18/06/2019 03:08, Finn Thain wrote: > >> On Mon, 17 Jun 2019, Douglas Gilbert wrote: >> >>> On 2019-06-17 5:11 p.m., Bart Van Assche wrote: >>> >>>> On 6/12/19 6:59 AM, Marc Gonzalez wrote: >>>> >>>>> According to the option's help message, SCSI_PROC_FS has been >>>>> superseded for ~15 years. Don't select it by default anymore. >>>>> >>>>> Signed-off-by: Marc Gonzalez >>>>> --- >>>>> drivers/scsi/Kconfig | 3 --- >>>>> 1 file changed, 3 deletions(-) >>>>> >>>>> diff --git a/drivers/scsi/Kconfig b/drivers/scsi/Kconfig >>>>> index 73bce9b6d037..8c95e9ad6470 100644 >>>>> --- a/drivers/scsi/Kconfig >>>>> +++ b/drivers/scsi/Kconfig >>>>> @@ -54,14 +54,11 @@ config SCSI_NETLINK >>>>> config SCSI_PROC_FS >>>>> bool "legacy /proc/scsi/ support" >>>>> depends on SCSI && PROC_FS >>>>> - default y >>>>> ---help--- >>>>> This option enables support for the various files in >>>>> /proc/scsi. In Linux 2.6 this has been superseded by >>>>> files in sysfs but many legacy applications rely on this. >>>>> - If unsure say Y. >>>>> - >>>>> comment "SCSI support type (disk, tape, CD-ROM)" >>>>> depends on SCSI >>>> >>>> Hi Doug, >>>> >>>> If I run grep "/proc/scsi" over the sg3_utils source code then grep reports >>>> 38 matches for that string. Does sg3_utils break with SCSI_PROC_FS=n? >>> >>> First, the sg driver. If placing >>> #undef CONFIG_SCSI_PROC_FS >>> >>> prior to the includes in sg.c is a valid way to test that then the >>> answer is no. Ah, but you are talking about sg3_utils . >>> >>> Or are you? 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. Those 6 are all for direct IO >>> (see below) which is off by default. I suspect old scanning >>> utilities like sg_scan and sg_map might also use /proc/scsi/* . >>> That is one reason why I wrote lsscsi. However I can't force folks >>> to use lsscsi. As a related example, I still get bug reports for >>> sginfo which I inherited from Eric Youngdale. >>> >>> If I was asked to debug a problem with the sg driver in a >>> system without CONFIG_SCSI_PROC_FS defined, I would decline. >>> >>> The absence of /proc/scsi/sg/debug would be my issue. Can this >>> be set up to do the same thing: >>> cat /sys/class/scsi_generic/debug >>> Is that breaking any sysfs rules? >>> >>> >>> Also folks who rely on this to work: >>> cat /proc/scsi/sg/devices >>> 0 0 0 0 0 1 255 0 1 >>> 0 0 0 1 0 1 255 0 1 >>> 0 0 0 2 0 1 255 0 1 >>> >>> would be disappointed. Further I note that setting allow_dio via >>> /proc/scsi/sg/allow_dio can also be done via /sys/module/sg/allow_dio . >>> So that would be an interface breakage, but with an alternative. >> >> You can grep for /proc/scsi/ across all Debian packages: >> https://codesearch.debian.net/ >> >> This reveals that /proc/scsi/sg/ appears in smartmontools and other >> packages, for example. > > Hello everyone, > > Please note that I am _in no way_ suggesting that we remove any code. > > I just think it might be time to stop forcing CONFIG_SCSI_PROC_FS into > every config, and instead require one to explicitly request the aging > feature (which makes CONFIG_SCSI_PROC_FS show up in a defconfig). > > Maybe we could add CONFIG_SCSI_PROC_FS to arch/x86/configs/foo ? > (For which foo? In a separate patch or squashed with this one?) Marc, Since current sg driver usage seems to depend more on SCSI_PROC_FS being "y" than other parts of the SCSI subsystem then if SCSI_PROC_FS is to default to "n" in the future then a new CONFIG_SG_PROC_FS variable could be added. If CONFIG_CHR_DEV_SG is "*" or "m" then default CONFIG_SG_PROC_FS to "y"; if CONFIG_SCSI_PROC_FS is "y" then default CONFIG_SG_PROC_FS to "y"; else default CONFIG_SG_PROC_FS to "n". Obviously the sg driver would need to be changed to use CONFIG_SG_PROC_FS instead of CONFIG_SCSI_PROC_FS . Does that defeat the whole purpose of your proposal or could it be seen as a partial step in that direction? What is the motivation for this proposal? Doug Gilbert BTW We still have the non-sg related 'cat /proc/scsi/scsi' usage and 'cat /proc/scsi/device_info'. And I believe the latter one is writable even though its permissions say otherwise.