Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.5 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 784C7C433DB for ; Thu, 14 Jan 2021 07:16:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3EB862395C for ; Thu, 14 Jan 2021 07:16:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726819AbhANHQH (ORCPT ); Thu, 14 Jan 2021 02:16:07 -0500 Received: from mx2.suse.de ([195.135.220.15]:36484 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726510AbhANHQH (ORCPT ); Thu, 14 Jan 2021 02:16:07 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 49E3BAB92; Thu, 14 Jan 2021 07:15:26 +0000 (UTC) Subject: Re: [PATCH v13 37/45] sg: defang allow_dio To: Douglas Gilbert , linux-scsi@vger.kernel.org Cc: martin.petersen@oracle.com, jejb@linux.vnet.ibm.com, kashyap.desai@broadcom.com References: <20210113224526.861000-1-dgilbert@interlog.com> <20210113224526.861000-38-dgilbert@interlog.com> From: Hannes Reinecke Message-ID: Date: Thu, 14 Jan 2021 08:15:25 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.4.0 MIME-Version: 1.0 In-Reply-To: <20210113224526.861000-38-dgilbert@interlog.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org On 1/13/21 11:45 PM, Douglas Gilbert wrote: > Before direct IO was permitted by this driver, the user either had > to give 'allow_dio=1' as a module parameter or write to procfs > with 'echo 1 > /proc/scsi/sg/allow_dio'. The user also needs > to set the SG_FLAG_DIRECT_IO flag in the flags field of either > the sg v3 or v3 interface. The reason this "belts and braces" > approach was taken is lost in the mists of time (done over 20 > years ago). So this patch keeps the allow_dio attribute for > backward compatibility but ignores it, relying on the > SG_FLAG_DIRECT_IO flag alone. This brings the use of the > SG_FLAG_DIRECT_IO flag into line with the SG_FLAG_MMAP_IO > flag; the two mechanisms are no more, or less, safe than one > another in recent Linux kernels. > > Signed-off-by: Douglas Gilbert > --- > drivers/scsi/sg.c | 26 ++++++++------------------ > 1 file changed, 8 insertions(+), 18 deletions(-) > Reviewed-by: Hannes Reinecke Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), Geschäftsführer: Felix Imendörffer