From mboxrd@z Thu Jan 1 00:00:00 1970 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=-7.2 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 B1C0BC4320A for ; Mon, 23 Aug 2021 22:15:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8D12D61360 for ; Mon, 23 Aug 2021 22:15:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232979AbhHWWQa (ORCPT ); Mon, 23 Aug 2021 18:16:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233086AbhHWWQZ (ORCPT ); Mon, 23 Aug 2021 18:16:25 -0400 Received: from fieldses.org (fieldses.org [IPv6:2600:3c00:e000:2f7::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06381C061757; Mon, 23 Aug 2021 15:15:42 -0700 (PDT) Received: by fieldses.org (Postfix, from userid 2815) id E007261D7; Mon, 23 Aug 2021 18:15:40 -0400 (EDT) DKIM-Filter: OpenDKIM Filter v2.11.0 fieldses.org E007261D7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fieldses.org; s=default; t=1629756940; bh=l2+VDl22MUqiJrQ7yjAxRz1AbDeU5j4i2UbWV/QLqD4=; h=Date:To:Cc:Subject:References:In-Reply-To:From:From; b=McGzShEW/vXjM4IRYOjJ+shVasZozVIid5BDJJ2VYRGy+EHtfNnTNgQ4h+L2TBCHp zQKurWjb279b0w+wQ6w9kGYY+aXZI+AdvWjdHDmNpgibbuiYOmUeStmXMbWp0bLruC pIgBMGTvurkJvdPhEuOmU9KHgkSzQs6oedCvcTyQ= Date: Mon, 23 Aug 2021 18:15:40 -0400 To: Jeff Layton Cc: "H. Peter Anvin" , Kees Cook , Linus Torvalds , "Eric W. Biederman" , Matthew Wilcox , Andy Lutomirski , David Laight , David Hildenbrand , Linux Kernel Mailing List , Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Al Viro , Alexey Dobriyan , Steven Rostedt , "Peter Zijlstra (Intel)" , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Petr Mladek , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , Greg Ungerer , Geert Uytterhoeven , Mike Rapoport , Vlastimil Babka , Vincenzo Frascino , Chinwen Chang , Michel Lespinasse , Catalin Marinas , Huang Ying , Jann Horn , Feng Tang , Kevin Brodsky , Michael Ellerman , Shawn Anastasio , Steven Price , Nicholas Piggin , Christian Brauner , Jens Axboe , Gabriel Krisman Bertazi , Peter Xu , Suren Baghdasaryan , Shakeel Butt , Marco Elver , Daniel Jordan , Nicolas Viennot , Thomas Cedeno , Collin Fijalkovich , Michal Hocko , Miklos Szeredi , Chengguang Xu , Christian =?utf-8?B?S8O2bmln?= , "linux-unionfs@vger.kernel.org" , Linux API , the arch/x86 maintainers , "" , Linux-MM , Florian Weimer , Michael Kerrisk Subject: Re: Removing Mandatory Locks Message-ID: <20210823221540.GB10881@fieldses.org> References: <87k0kkxbjn.fsf_-_@disp2133> <0c2af732e4e9f74c9d20b09fc4b6cbae40351085.camel@kernel.org> <202108200905.BE8AF7C@keescook> <8a6737f9fa2dd3b8b9d851064cd28ca57e489a77.camel@kernel.org> <18b073b95d692f4c7782c68de1f803681c15a467.camel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18b073b95d692f4c7782c68de1f803681c15a467.camel@kernel.org> User-Agent: Mutt/1.5.21 (2010-09-15) From: bfields@fieldses.org (J. Bruce Fields) Precedence: bulk List-ID: X-Mailing-List: linux-unionfs@vger.kernel.org On Sat, Aug 21, 2021 at 08:45:54AM -0400, Jeff Layton wrote: > On Fri, 2021-08-20 at 17:29 -0400, Jeff Layton wrote: > > No, Windows has deny-mode locking at open time, but the kernel's > > mandatory locks are enforced during read/write (which is why they are > > such a pain). Samba will not miss these at all. > > > > If we want something to provide windows-like semantics, we'd probably > > want to start with something like Pavel Shilovsky's O_DENY_* patches. > > > > -- Jeff > > > > Doh! It completely slipped my mind about byte-range locks on windows... > > Those are mandatory and they do block read and write activity to the > ranges locked. They have weird semantics vs. POSIX locks (they stack > instead of splitting/merging, etc.). > > Samba emulates these with (advisory) POSIX locks in most cases. Using > mandatory locks is probably possible, but I think it would add more > potential for deadlock and security issues. Right, so Windows byte-range locks are different from Windows open deny modes. But even if somebody wanted to implement them, I doubt they'd start with the mandatory locking code you're removing here, so I think they're irrelevant to this discussion. --b.