Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp124353pxj; Thu, 27 May 2021 23:22:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSWA0AeaDlGt5XfFw+p2ZSRViSTq2CqxeY7L+6Ob81jcErZjFLKdf1owZ2U4A9BjqmPvFE X-Received: by 2002:a05:6402:4251:: with SMTP id g17mr8428784edb.238.1622182930108; Thu, 27 May 2021 23:22:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622182930; cv=none; d=google.com; s=arc-20160816; b=otitI+ffITlZ0kQ4ovkWaISaDo/f8AgxT2tIVpknR8TUgvCsV0gr7XQk7nJIc3RmnD O4IBBJmHzbOlbKOVaZ4/5BAOaVs45kp7fTNcPzbnfkLyM1z0Ni8wKk0ZX2TuDd09Fwwn znSyT3LhW4mZRX03Wsjhmk/BpsFTfZBB2iunvN/MLs94mnhXwtDcEB1pNCnJk1M86xmO a0TpC+G/No9rnsz0XoZo+MsTGSv/NAB29srqAS26WzYdw9VHoMU3ozvE0D7IDTxDwq8a AuYmnPcljg5oQNub90c+qcUNS4Lqh/BRjO2eu49DQpacPLdkCwfy5dm3cbUumK2lVyKn mOrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:mime-version :content-transfer-encoding:dkim-signature:dkim-signature; bh=lf/+eyXUUYbQ1axVyCT91t5kYmjbn3mXiPxb/rcORlw=; b=JH1q2VipB7WqeUyTkt8OG7IuqRGU0UyijzEeDX55EK8jqk/SoA+BIy1MyTXapEg/Sy MYIlImzZKcvxo5H7YWMvk1VLV86Q3Evc1ys3OlLNEemWZRvX7giGvp0CqMfzzzzWAgvH 2soxEX27oG0FyyNGTQ1AqvIfHvpIZIgr1m5QI7VWMXnzhKQ9xCeIE6FAjvq1K8gwgPr+ +ieQfmSkFgaDvZhbl2xaDw0izYwL1V4d+7jS0VkVSK1hrBzOjvEDGd+t104XU2U76T86 oLFJoeUtyRTrU9do/nDTsq2YD7SqbvFGTQVqvMMlrdmmWQo8cGLFhdbsa8ozF2QxowSC eazg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=es0EAR2o; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k27si2620101eja.584.2021.05.27.23.21.47; Thu, 27 May 2021 23:22:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=es0EAR2o; dkim=neutral (no key) header.i=@suse.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234809AbhE1FSy (ORCPT + 99 others); Fri, 28 May 2021 01:18:54 -0400 Received: from smtp-out2.suse.de ([195.135.220.29]:38528 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234573AbhE1FSx (ORCPT ); Fri, 28 May 2021 01:18:53 -0400 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 736871FD2F; Fri, 28 May 2021 05:17:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1622179037; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lf/+eyXUUYbQ1axVyCT91t5kYmjbn3mXiPxb/rcORlw=; b=es0EAR2op8pXmWGW0oPzsz9ADc+BmicfJz2uV5j/iDYLr8Da7m9Am/TtSaQe6ouur5wufJ K0OZd7oASKn6aFx0J3XKzeGeTQITGjN3InTiok3tjbMxp9ZyqBcrBY/UQPIMy7J8yCMP+y 2yAzzMwnuXDiIeoEczmFL8DPT+Zwka8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1622179037; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=lf/+eyXUUYbQ1axVyCT91t5kYmjbn3mXiPxb/rcORlw=; b=oHc6aSsIML9x6av81AQVbX9VdLcsCBKwrnw9C7zL0+wWIa/FuHwLKTcaUf5EjGvws84Wc8 BCxY4+m1wjG3nhAg== Received: from director2.suse.de (director2.suse-dmz.suse.de [192.168.254.72]) by imap.suse.de (Postfix) with ESMTPSA id CE82411A98; Fri, 28 May 2021 05:17:15 +0000 (UTC) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 From: "NeilBrown" To: Al Viro Cc: Andrew Morton , LKML , James Simmons Subject: [PATCH] vfs: allow O_PATH file descriptors for open_by_handle_at() Date: Fri, 28 May 2021 15:17:12 +1000 Message-id: <162217903209.27719.15641706922296023647@noble.neil.brown.name> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The purpose of the "mount_fd" arg to open_by_handle_at() is solely to identify a particular mount. i.e. it indicates "a location in the filesystem tree" which is one of the purposes of O_PATH. So change fdget() to fdget_raw(). Cc: stable@vger.kernel.org # O_PATH introduced in 3.0+ Signed-off-by: NeilBrown --- This seems generally sensible, but will particularly be useful in preparing the Lustre filesystem for upstream. fs/fhandle.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/fhandle.c b/fs/fhandle.c index ec6feeccc276..0020a0afdf86 100644 --- a/fs/fhandle.c +++ b/fs/fhandle.c @@ -122,7 +122,7 @@ static struct vfsmount *get_vfsmount_from_fd(int fd) mnt = mntget(fs->pwd.mnt); spin_unlock(&fs->lock); } else { - struct fd f = fdget(fd); + struct fd f = fdget_raw(fd); if (!f.file) return ERR_PTR(-EBADF); mnt = mntget(f.file->f_path.mnt); -- 2.31.1