Received: by 10.213.65.68 with SMTP id h4csp1785539imn; Thu, 5 Apr 2018 03:53:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx49kfo2Pb3P3yG4WZf68r5mL8aGC7EERlxZyzsdK9DdoOI6yYEC68WlmRawDMxWIohMPoFoj X-Received: by 2002:a17:902:a501:: with SMTP id s1-v6mr22523844plq.201.1522925617726; Thu, 05 Apr 2018 03:53:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522925617; cv=none; d=google.com; s=arc-20160816; b=ldOX8culMN8cULVKaGUjyzI50uNAewlLYcO991LfiWhHoGNrZ1/JoU7aCUtZ3HkK2t 5YwGoVzBgzQ5IgSAx2voy6kIKAPNxIibQ0CoKr4celNHDTNYo5vl/erEhXem6LcDoLEm FPxbshq5pvUwqsAe5WzYOqm8AUkDUVnpWk2588dFTTmUo1Ad1ouiHwTAcJinVciv3oKh Kn5wN/4nXi08qFe2JCHgI+b0fzZZOuUT0dtp+sm3/v0rLs+wmV/BBPaqfMWsIvd0PVV9 +WbjW7b6pXXAjsVYGrSnjvgzFZsvTL1kAp+QCditJGYEMvGHOF5wV/g/7SIuzIubdV5G AnCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=HUErpndKYkyHjZXFatlOWxgvCjGTQxFpScSAPzGZZsI=; b=HniHv0hhp+7D8SMTl4XfrTuF2pk2IdE/M/UuiqLkcIsilxT7r/D4xCWyCTjL8FZlkr sFfkP9mTf/St6uZtpsaSz+eXkyOLJuvIemUhv+VAzJxPsYrq20SPolOCKAskQeNv44Bl oOTfle0RuadiZkqrBQ2tQ1tePRvulsMfKxkmV0V9fmxqRO+PwG7IJt4/DswvjASU12Di 41cM3MQ6DIZkoFrjinhFuVOr5WJo0PEQdq5KPjWDSnGoM9rLvGcGynzZWTnQHFCIOaVj H405MsvtGFlGSlRsqBl/3ZrvnCjM2PXi4o1W38XUq9W4yvytYZ7CN4Q77+JmpXfEQcZ3 kL2w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s1-v6si5260291plr.109.2018.04.05.03.53.24; Thu, 05 Apr 2018 03:53:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751414AbeDEKvV (ORCPT + 99 others); Thu, 5 Apr 2018 06:51:21 -0400 Received: from mail-wm0-f43.google.com ([74.125.82.43]:37319 "EHLO mail-wm0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751097AbeDEKvU (ORCPT ); Thu, 5 Apr 2018 06:51:20 -0400 Received: by mail-wm0-f43.google.com with SMTP id r131so5752935wmb.2 for ; Thu, 05 Apr 2018 03:51:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=HUErpndKYkyHjZXFatlOWxgvCjGTQxFpScSAPzGZZsI=; b=HdsIb9lYaoL841bCIKXudOcr3MORso9BKsDvmcdIravSsstmmw4qMgQl81eIo/0ajf wzO+10Bj3iP30voxNmI89zAgFskMRPLPsw7129YSHLJakeMLgr4jqDo+nXad58fYm1CU FZlY7gntyIn6oODQBxEEFWUUY4XSXRfGw2xiI+0MrMrf03D3uOsKLRzKiXjeiMtBmW4V ZxTUwNnw8r2bSL1txl6izG6OrvihkYZPnoWYkRlWGi8vzOPQz3jzzZxcikpHUyJtp0oq EEqkxxxdtcCYtCVsLTh+lIztiszH3K2Xr5WxirvEAbgiWzyFWlS0AQevaVJNNSUfStm7 14TQ== X-Gm-Message-State: AElRT7GujwOjjD+/jYfe9HbsadWw6KeBeEL/EX16NKF9Djlk1qjRP5mh qRKyKXC5bBEaCytPU5LCZQ8= X-Received: by 10.28.192.8 with SMTP id q8mr9211235wmf.103.1522925479299; Thu, 05 Apr 2018 03:51:19 -0700 (PDT) Received: from localhost.localdomain (u-086-c187.eap.uni-tuebingen.de. [134.2.86.187]) by smtp.gmail.com with ESMTPSA id n47sm8418599wrf.41.2018.04.05.03.51.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 05 Apr 2018 03:51:18 -0700 (PDT) From: Christian Brauner To: torvalds@linux-foundation.org, viro@zeniv.linux.org.uk, ebiederm@xmission.com, linux-kernel@vger.kernel.org Cc: Christian Brauner Subject: [PATCH 0/3 RESEND] namei: add follow_up_bind() Date: Thu, 5 Apr 2018 12:51:00 +0200 Message-Id: <20180405105103.21572-1-christian.brauner@ubuntu.com> X-Mailer: git-send-email 2.15.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi everyone, (Resending since Linus email got mangled on my terminal. Sorry.) Back when we fixed TIOCGPTPEER again in commit a319b01d9095 ("devpts: resolve devpts bind-mounts") we discovered [1] that the code for bind-mount resolution we needed to add in devpts_mtnget() was already duplicated in nfsd code. So we briefly discussed [2] adding a helper to namei.{c,h} that would resolve bind-mounts. The bind-mount resolution code is replicated in at least two places: - fs/nfsd/vfs.c:follow_to_parent() - fs/devpts/inode.c:devpts_mntget() This series adds: - follow_up_bind() to namei.{c,h} - switches fs/nfsd/vfs.c:follow_to_parent() to use follow_up_bind() - switches fs/devpts/inode.c:devpts_mntget() to use follow_up_bind() I just wanted to wait until the devpts patches I sent would make it into mainline. Seems to me that this helper might be worth having around. Not just because it avoids (granted rather trivial) code duplication but also because it makes the concept of resolving a bind-mount up to the origin mountpoint of the vfs's mount obvious (which at least to me wasn't obivous before). [1]: https://lkml.org/lkml/2018/3/11/219 [2]: https://lkml.org/lkml/2018/3/12/486 Thanks! Christian Christian Brauner (3): namei: add follow_up_bind() devpts: use follow_up_bind() helper nfsd: use follow_up_bind() helper fs/devpts/inode.c | 4 +--- fs/namei.c | 10 ++++++++++ fs/nfsd/vfs.c | 4 ++-- include/linux/namei.h | 1 + 4 files changed, 14 insertions(+), 5 deletions(-) -- 2.15.1