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=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 55364C11D28 for ; Fri, 21 Feb 2020 05:02:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2D06E24656 for ; Fri, 21 Feb 2020 05:02:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725973AbgBUFCU (ORCPT ); Fri, 21 Feb 2020 00:02:20 -0500 Received: from zeniv.linux.org.uk ([195.92.253.2]:46384 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725372AbgBUFCU (ORCPT ); Fri, 21 Feb 2020 00:02:20 -0500 Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j50Rx-00GAaV-Pv; Fri, 21 Feb 2020 05:02:05 +0000 Date: Fri, 21 Feb 2020 05:02:05 +0000 From: Al Viro To: Aleksa Sarai Cc: Florian Weimer , "Darrick J. Wong" , Christoph Hellwig , linux-xfs@vger.kernel.org, libc-alpha@sourceware.org, linux-fsdevel@vger.kernel.org, Rich Felker Subject: Re: XFS reports lchmod failure, but changes file system contents Message-ID: <20200221050205.GW23230@ZenIV.linux.org.uk> References: <874kvwowke.fsf@mid.deneb.enyo.de> <20200212161604.GP6870@magnolia> <20200212181128.GA31394@infradead.org> <20200212183718.GQ6870@magnolia> <87d0ajmxc3.fsf@mid.deneb.enyo.de> <20200212195118.GN23230@ZenIV.linux.org.uk> <87wo8rlgml.fsf@mid.deneb.enyo.de> <20200221040919.zmsayko3fnbdbmib@yavin.dot.cyphar.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200221040919.zmsayko3fnbdbmib@yavin.dot.cyphar.com> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Fri, Feb 21, 2020 at 03:09:19PM +1100, Aleksa Sarai wrote: > * open(/proc/self/fd/$n) failing with ELOOP might actually be a bug > (the error is coming from may_open as though the lookup was done with > O_NOFOLLOW) -- the nd_jump_link() jump takes the namei lookup to a > the symlink but it looks like the normal link_path_walk et al > handling doesn't actually try to continue resolving it. I'll look > into this a bit more. Not a bug. Neither mount nor symlink traversal applies to destinations of pure jumps (be it a symlink to "/" or a procfs symlink). Both are deliberate and both for very good reasons. We'd discussed that last year (and I'm going to cover that on LSF); basically, there's no good semantics for symlink traversal in such situation. Again, this is absolutely deliberate. And for sanity sake, don't bother with link_path_walk() et.al. state in mainline - see #work.namei or #work.do_last in vfs.git; I'm going to repost that series tonight or tomorrow. The logics is easier to follow there.