Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp192490imm; Tue, 22 May 2018 16:50:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrdNeiOKHSlIdXgqaQp62Fvt4GFWOIfZvhj5l9O6SUMFk7SuDRiwLwVz/fVz7kvs1TYo1U0 X-Received: by 2002:a63:4d2:: with SMTP id 201-v6mr408430pge.129.1527033029128; Tue, 22 May 2018 16:50:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527033029; cv=none; d=google.com; s=arc-20160816; b=vDuDI2urdpzSp82C/282lo31+KPiQbPAeb24F9iSAb4wjne1IrUv0+01kfpNxyf8hA vfNbnWBvNcQTZC9VD0CMwVW8zpvrk7wKB/DYXs1+0QEx2outhQHNi0nuH7929x+qHHtT mkX1u9JlRERbdu45PhL8lbWHxRBN4AT8JHxDiTQVwNlCLxyffHad4Z3LyS7I6BcwnPwJ vUi0XbjaGoH0bOMLEP/Gw9YYeP8UJkj/Dcr1IrN+O2Cxo+Df295KlR8ZmCrM6npCZzBl 3agdyt8XgObLM6nMJIJRPG1pxCKkpw/6ownc+ud+rgdKAvArtT2H8yrSjZcoibWuUYsM TMTA== 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:cc:to:subject :message-id:date:from:references:in-reply-to:mime-version :dkim-signature:dkim-signature:arc-authentication-results; bh=E9It8hlWEVM8EC/O/NpMkH6sUpksXuOKMREqV8mxMmg=; b=DiZMVIbepap+qEXcRDAaOf2XrL8I15+pNPxjDpgXefJN2cM55d+mUQkUZjq6aZi5cC G2HHqQdFp8l7F6+TsQfKwPzPgHSjlMO5bp0tZKGaDkZBoZicn44hEiKGZ8oQ7gJURvYF 3cko1fP6TRj+8+kBXFE4KZnQZhH8OWA0ta+w8fA/V8zQ6M+BWa0tjajrzU+Z/zHDCWjD 08DpVOoqg2AP/ZAkcaEHF6w+A7eWGNGN8Bz0Sw8N2nmzhgASP0J30TngPv0wGwzp00E6 kqYDpjBUcNVFbo3FSA3nY2K2Ku4m6PBNpEayM8COZQWJ8Hya/Izjsw013QzDo7U9YX9w xF+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=tEb16XbT; dkim=fail header.i=@chromium.org header.s=google header.b=a/bH4GMd; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t7-v6si17894932pfa.170.2018.05.22.16.50.14; Tue, 22 May 2018 16:50:29 -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=fail header.i=@google.com header.s=20161025 header.b=tEb16XbT; dkim=fail header.i=@chromium.org header.s=google header.b=a/bH4GMd; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753456AbeEVXuD (ORCPT + 99 others); Tue, 22 May 2018 19:50:03 -0400 Received: from mail-ua0-f193.google.com ([209.85.217.193]:42282 "EHLO mail-ua0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753319AbeEVXuA (ORCPT ); Tue, 22 May 2018 19:50:00 -0400 Received: by mail-ua0-f193.google.com with SMTP id f3-v6so13517451uan.9 for ; Tue, 22 May 2018 16:49:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=E9It8hlWEVM8EC/O/NpMkH6sUpksXuOKMREqV8mxMmg=; b=tEb16XbTrpIRFJwIS2iZLBglV5/c8lBYyjIMPRun0WwnyJ52oSpZB+ovsTrIgSbSuy ZoXoULRT2QYb6K+ePdj9szsk9yUEO23t6gTvRgFcEZuujXz2J7wAVvoapMJt4wxraxAw +oRNw1cQ3f4cTKSmTp9zV3eDerxAR17gZC6sSU1Zpj7L5n4vOMdHwnmJBR/8FQd8VqAZ ir+6wMMytkN49p1G/5jIPpwJjNKr1xbO6WCH6Vq5NRnazCqRDIYxbk5qHfxH8LzM48TL JEtcMU5y8AISJPwXbw9KMjLCA8FvfHhVwojzA/8GforNweMjvKZ/IcXYT5mn3AqEihA8 Nc7g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-transfer-encoding; bh=E9It8hlWEVM8EC/O/NpMkH6sUpksXuOKMREqV8mxMmg=; b=a/bH4GMdeZNitPPk/+kmEqBqCNWz2HFVt1eMGQGzl+OWDSsGDnWEUN69H4CFANJt2f MaAPh0Ii115TMk7bZhSkm3NTNgKtLkQkqKWLabtLbLNJ2mtMh/+kXx/18evvuKcWNv/f 5uXmvn1/kLAlKw61ChE+VHksUEAILz+28ez2Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc:content-transfer-encoding; bh=E9It8hlWEVM8EC/O/NpMkH6sUpksXuOKMREqV8mxMmg=; b=tMw/BFHUoYEApvJj7eAG9xdqEdl7IgSYwrDMOn4RG9FcZ/R2CK6QBA1mB8kfXbO79E SQHKHUe3owrS2XHHTrkey5eHanwdhLmDmrmf8QWdK+gsJzWIiz02jPxs79Xu/+8fEzVY MLCwU+gF69eHyB5vDmJY/Y2rYRrCuvacsNEQOz4s1NbwQ4RedeNT+K6HBP1Zur7YLRdy 2+JDA8NiDZJjmawyYl5DHynSv7/9thofzkqbwbnWD/a7+r4H3colzmwRNNGXspPhlMG+ Zhv9GHYl8MbH0HWXQNvFx8c8hEYnI8Gfmu0wOwR9LDsCOe+Mnd1EpHb2aSwRglTwvXXx bQbQ== X-Gm-Message-State: ALKqPwcYLkbysQdZzc3AZN5NzPUqvzmvHlj3h9F2J/LS7ueyvw8AtLU4 81Wy9yg5QZ7BxDAdu1k4n9i9ioTig+938/yqUy50xg== X-Received: by 2002:ab0:b2:: with SMTP id 47-v6mr416074uaj.74.1527032999249; Tue, 22 May 2018 16:49:59 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a1f:bd1:0:0:0:0:0 with HTTP; Tue, 22 May 2018 16:49:58 -0700 (PDT) In-Reply-To: <9A0BC289-4203-4C77-A012-AAB07F42061F@kernel.dk> 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: Kees Cook Date: Tue, 22 May 2018 16:49:58 -0700 X-Google-Sender-Auth: ShJWk9w0_C7syHalNZ6Qf-1T5QE Message-ID: Subject: Re: [PATCH 3/6] block: Create scsi_sense.h for SCSI and ATAPI To: Jens Axboe 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 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, bu= t >>>>> 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 practi= cal terms it doesn=E2=80=99t matter that much, since most folks would be us= ing 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) +=3D 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) +=3D 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 -Kees --=20 Kees Cook Pixel Security