Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp898829imm; Wed, 23 May 2018 07:15:05 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqn1WmjpeDaxXmezv6WRKgqjQwz1L/U872ZlJZEH72aCpWRxppU/aSod5GcxjZ/nP27r8lA X-Received: by 2002:a62:ca98:: with SMTP id y24-v6mr3064398pfk.187.1527084905177; Wed, 23 May 2018 07:15:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527084905; cv=none; d=google.com; s=arc-20160816; b=0dwmYuHk79Dij9mgkPzM0v8tdomlxD80q9xgoJ1WjSicIPGq06PA7OPRFx2za2HsO3 NiFzfySJoYa2b8/4NRZDpd6Zpv/o94VOYbvsq/e+Nggf+WbaTT55PCyPcSGu0jbStGg+ BpQEk1kRy37e9z8pbjJq2QTtnRN3TGy0X2iVL9wPiF4tlMsrTpyF6Ij7ctxDHVmqV5Ow BSoNHAi+8okU4Cc8Jq66zcX4Qmzb0lg+n+LpHSwEZGJsRuGaL37kA1H6NvJtvY4GiiQU TiIpOW7As6wYC0wF/R20VwF/W0A9hekoE4v3BHbv7v0+0iNV24XQU45IVLLDiXmnmpoh mf8g== 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:dkim-signature :arc-authentication-results; bh=b6iK83K+E72ouIC2HuqKulU2El8Iewkuhzekhcmwfzs=; b=kKU/MN+EMH2tjJcDGQIfRBKE5q7xwrBm65giWXiZ4JNhZ8X0jAZ1HczyDwDksSAm8c TSVYFwwKaNtKOEoLxduMuw+8HA0qgPhEovLnygtcrxlf/HDWlNfbmPksoCNwIqW4Ovvj /6D1y1hMqMA5jceI8E/TvLhZIc8o6aHsBLiQHVP/0mUbzOvDtHz+dMV7TKb+qTKhFX1K AByEkYOsF0bM4rG1KPKvy4BSBrpn1dSj+/FjbiTHX2l0Nm3ZC5b8XDQm+u8IRllNsU6F p6+maBDRk2MLU12gcinlFCefkL2Zg+pRivN7Ks/LK6+riUvmj28nGna14eE1e5G8Ifq8 pdwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=rmfFxDuo; 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 bj6-v6si18734841plb.405.2018.05.23.07.14.42; Wed, 23 May 2018 07:15:05 -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; dkim=pass header.i=@kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=rmfFxDuo; 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 S933230AbeEWOOE (ORCPT + 99 others); Wed, 23 May 2018 10:14:04 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:46397 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933080AbeEWOOA (ORCPT ); Wed, 23 May 2018 10:14:00 -0400 Received: by mail-io0-f193.google.com with SMTP id f21-v6so22937531iob.13 for ; Wed, 23 May 2018 07:14:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=b6iK83K+E72ouIC2HuqKulU2El8Iewkuhzekhcmwfzs=; b=rmfFxDuodmGJNqgzW4al6mRwsxHq16f/QjNSBV+pLfXQBhmZT0Y1Wtc9rbRsYb7JgN Ux6vVWxOmleqC2UWgA4p4yNd+WiG6nzUHbTlODNQKcE99DtTGS/T9zkKFzejyd9MBDEa fnIOdA7zoDlyUMslPvV9cUCTeoLuhThXpLn2lwVKrsjYbeJ40NsnmUnlXun24h28yOYP vixdaY1G4+PX2NyYzXvn+d6/KL3e6nubA53Ne+9zxvBwfVA19ckU71a8thtxQads35o0 fRo5a2VlIyRCACEB8bxZCdKzfrTcr++Q6TDFuuLLPcYfQcxMOnjHvMRYtCfo4olkHGXe rBZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=b6iK83K+E72ouIC2HuqKulU2El8Iewkuhzekhcmwfzs=; b=NfgLltq+8wUHWK9Kp+Ah3FCRwNDlKkKqKHqBIwag/ZImz2jgx+kuJeIRLilxDOylOt vI7iUrxYWoMgvm8mYnZbjsmxcgvAjd0+eS7Zz6yqbB/pMDFEppUv7HZSvD/Ag+mwM0EA xsZxqot/8SE72xImQxcZAHTPnrjfEvF1BR7ihp/b4AGG1kt6f4RXm5/hxaSQU/2kCyGv whsOTbyM64rLQtEnittVyTurRhDzcFZzM9jz4CLDi0VThCQ6QXDoKue/7FvHsO3X5BBj uzO4FIUUwXoJl0tBVHCYol+LcVb1QlfEXQqNbrOq0fiUpXqxFEgDtNyewu5I49fUA6oY Mehg== X-Gm-Message-State: ALKqPwepKt24j96+7I8xeeYq2C9PcM5FeeKcPSgVOhEb9fVMbGjxJKj3 0DOC6C6deix0ee96RxxsitJLj0fQ/eY= X-Received: by 2002:a6b:d117:: with SMTP id l23-v6mr343094iob.3.1527084839224; Wed, 23 May 2018 07:13:59 -0700 (PDT) Received: from [192.168.1.167] ([216.160.245.98]) by smtp.gmail.com with ESMTPSA id e139-v6sm1208953ite.42.2018.05.23.07.13.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 23 May 2018 07:13:58 -0700 (PDT) Subject: Re: [PATCH 3/6] block: Create scsi_sense.h for SCSI and ATAPI To: Kees Cook Cc: Christoph Hellwig , "Martin K. Petersen" , James Bottomley , Tejun Heo , Borislav Petkov , "David S. Miller" , "Manoj N. Kumar" , "Matthew R. Ochs" , Uma Krishnan , linux-block , linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, LKML References: <20180522181512.39316-1-keescook@chromium.org> <20180522181512.39316-4-keescook@chromium.org> <20180522183613.GA3784@infradead.org> <732f4249-5681-4a54-ec21-4ecc3d3a74e5@kernel.dk> <20180522191309.GA23615@infradead.org> <8d4af5c4-96fa-54ee-d5c1-b887b1de5a3c@kernel.dk> <9A0BC289-4203-4C77-A012-AAB07F42061F@kernel.dk> From: Jens Axboe Message-ID: Date: Wed, 23 May 2018 08:13:56 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/22/18 5:49 PM, Kees Cook wrote: > On Tue, May 22, 2018 at 4:42 PM, Jens Axboe wrote: >> On May 22, 2018, at 5:31 PM, Kees Cook wrote: >>> >>>> On Tue, May 22, 2018 at 12:16 PM, Jens Axboe wrote: >>>>> On 5/22/18 1:13 PM, Christoph Hellwig wrote: >>>>>> On Tue, May 22, 2018 at 01:09:41PM -0600, Jens Axboe wrote: >>>>>> I think Martin and Christoph are objecting to moving the code to >>>>>> block/scsi_ioctl.h. I don't care too much about where the code is, but >>>>>> think it would be nice to have the definitions in a separate header. But >>>>>> if they prefer just pulling in all of SCSI for it, well then I guess >>>>>> it's pointless to move the header bits. Seems very heavy handed to me, >>>>>> though. >>>>> >>>>> It might be heavy handed for the 3 remaining users of drivers/ide, >>>> >>>> Brutal :-) >>> >>> Heh. I noticed a similar sense buffer use in drivers/cdrom/cdrom.c >>> too. Is this okay under the same considerations? >> >> This is going from somewhat crazy to pretty nuts, imho. I guess in practical terms it doesn’t matter that much, since most folks would be using sr. I still think a split would be vastly superior. Just keep the scsi code in drivers/scsi/ and make it independently selectable. > > I had originally tied it to BLK_SCSI_REQUEST. Logically speaking, > sense buffers are part of the request, and the CONFIG work is already > done. This is roughly what I tried to do before, since scsi_ioctl.c is > the only code pulled in for CONFIG_BLK_SCSI_REQUEST: > > $ git grep BLK_SCSI_REQUEST | grep Makefile > block/Makefile:obj-$(CONFIG_BLK_SCSI_REQUEST) += scsi_ioctl.o > > Should I move to code to a new drivers/scsi/scsi_sense.c and add it to > drivers/scsi/Makefile as: > > obj-$(CONFIG_BLK_SCSI_REQUEST) += scsi_sense.o > > Every place I want to use the code is already covered by > CONFIG_BLK_SCSI_REQUEST, so it seems like I just need to know where to > put the .c file. :P I think this is so much saner than a SCSI select or dependency, so I'll have to disagree with Martin and Christoph. Just put it in drivers/scsi, if it's the location they care about. -- Jens Axboe