From nobody Fri Sep 25 11:05:14 2026 Received: from mail-wm2-f13.google.com (mail-wm2-f13.google.com [74.125.225.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 378F22DB788 for ; Sun, 13 Sep 2026 14:49:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789310993; cv=none; b=ZE1TN1S/lzdqU+r+Z3BSm2jIuj+/VblYJpp86HxNfbQjRRkFVKNYcDoB9WcF6j1bmQwmcbyB5XJ4YKzs+QJSyIDqQUmfK5o0J3PyK3HDsjS3XFKv2ZOwrHvlTfs3Ij2nrpOJWdQLg4iwWs909yCElyil6JLnGcejigrVlnuhY/A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789310993; c=relaxed/simple; bh=fqYdfhM4n383iQRBDpq26Y/X/oP3mbwZS2rLGUBKObg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Z7sN/4IKXUWPNrW8QTeM5OCfmuC8TLWDqGdmqaVn/TKiQqJyqVEnttKu7fJJu8zDmmTb5iXopUWqIYcvjkG+1Zv94mKnGHCrA32e0NyJ0u1H8X/YfNFhMLEMfGiCHzbif/e1tfjlcqk+NguJ1iw++FVXAPU+wn0JsxeALQqZ94E= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OlIGExBY; arc=none smtp.client-ip=74.125.225.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OlIGExBY" Received: by mail-wm2-f13.google.com with SMTP id 5b1f17b1804b1-49e7355e411so6882085e9.1 for ; Sun, 13 Sep 2026 07:49:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789310990; x=1789915790; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=T4XBkc/3o0TvhdU75Gq1POY2139HpfJ6MiGPK2mRXWA=; b=OlIGExBYCSathE9wDoDaWXy2tD0fEennZMed0JSIO8WfQCCQ3nNYLGEpxmcmdrW6CB Gn6VY6cKnVntDFw0r7faBmfG/Na4P6W3377mRVodYxd2SyZPCnXpN0+gSesM5U4oAmPA g6opE48AFt08pkB74q2o4CVnak9WRnV1CiPRzWP7oPyC7VQvMEmLfe4UfKBsdLXG4LFZ pOCtoI8iq3erVCjjzhY5cbsI4mkGk8WafhS2JtMnrcaEKGwFh+fB4oQ8DK5yni8XOkcX cTDtIvqe74ilYr3sOPJiBqr03nCFuOOwTwNnF4f8yybGR/+Qb74+9uUD8f7obbVWQzFP Zh6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789310990; x=1789915790; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=T4XBkc/3o0TvhdU75Gq1POY2139HpfJ6MiGPK2mRXWA=; b=GKRxqTPEsgxl4tpiEQV3ymUDQO27bdl8yGPLkADF+V8bPkzcf9fa3YNK5tT4hf/Tyg z43loH++/miz7ila+sKyYK1r8gQKt+CLDDp/Zf9Mzx6S5Lr4ok6eKwPwTisi6cqtxA/G rvKkLAdzyAdSlBAdupCR/Y8tcU737l8X8t//WTZ9ijYdfGv4JjkfLis/5Xs0Vr9TByZq SHw3zN3QGtdTJjO0VDLiONXUWseYgIipRsh2qsDYyBodVx8F2uoGtMdc+175EHRKc0Zt PZHT5sm3d+JnbfWGha5YVlWmHzrs34Tvw1piles9b8AJFOH99EU/zw8HzFEdOp0Fz/gi 3E2A== X-Forwarded-Encrypted: i=1; AKwUvBzN7+XNbj8v5nowNWX2aVIPm2ZxAPeEXb8MfPEpoVU1r3C09j4TmJnixKrD6MbzIfpVCt6eQ17etwGtDmA=@vger.kernel.org X-Gm-Message-State: AFuF++kNnNMYhMuRSAvnvLcTL30bFNPufZ3590W6ok++f7Qo0tsNf97n 8yK50j/KyovKRiTvJeizTzbuCqybGrs3ZIw6UcYgLlmb9fwde08FnF/b X-Gm-Gg: AYBFou0fFsa13SMB3zqMPmln4GgT/oPtyjgiaTxHsRHqAwSbfTVHQXdBKXqt77Vj+W3 fQ53u7bmH4QCGPtFafeQiYuOSGh3QdtRZQfbXuaphmIActEMO5SqUuscNwgWhb8UvHLkIKtttFC MUFZI/sn8J6wtn6oPu0WXtgMH9kRB7zI/OP4t418bC1I1pSHKzmpxSJqkjexQS2mcWViq3//PqV LNQMIcGu3YghK534ooErPS28eivM+vT/98ICFNZEXPP+EeF7QTFyUF60JYxuewPYjT1Xu6ITemh 5lsZNdDPr0Jo8H5SKXMepZal06AYRZH1HNRt1ELs5Gpru3hIKA2e8FdmZcil8xtblwLHf9hqJ4W wZkwlHEhFm6rh4ZsjncTW8MMzONNjsgoj2CCjkixTHDBoaV2TSL9T0Oo++KG4cBIVtDIt000RZ9 vo9c1cImBtcw/K22yJe2yRsme+8ylZz8HA3ZGm6k8QZTdyGhGnpgo8r7+tdiefWonAg3DE3lVVH K/s5wlmMQdVVlzW99cT2BiY5hFgS2hWFOYMeixOiyA= X-Received: by 2002:a05:600c:3b90:b0:49c:d52e:d0ea with SMTP id 5b1f17b1804b1-49e619b397emr244436195e9.4.1789310990136; Sun, 13 Sep 2026 07:49:50 -0700 (PDT) Received: from f.. (cst-prg-84-1.cust.vodafone.cz. [46.135.84.1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e6420de77sm109534235e9.3.2026.09.13.07.49.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 07:49:49 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Mateusz Guzik Subject: [PATCH 01/10] fs: unexport backing_file_set_user_path() and make it take the ref on its own Date: Sun, 13 Sep 2026 16:49:08 +0200 Message-ID: <20260913144918.1606123-2-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260913144918.1606123-1-mjguzik@gmail.com> References: <20260913144918.1606123-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Prep for path_* API changes, which will force the ref change. There are likely no users outside of the tree, but should there be some they will no longer be caught by surprise. Signed-off-by: Mateusz Guzik Reviewed-by: Jan Kara --- fs/backing-file.c | 2 -- fs/file_table.c | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/backing-file.c b/fs/backing-file.c index cc101143f921..e92410a27982 100644 --- a/fs/backing-file.c +++ b/fs/backing-file.c @@ -43,7 +43,6 @@ struct file *backing_file_open(const struct file *user_fi= le, int flags, if (IS_ERR(f)) return f; =20 - path_get(user_path); backing_file_set_user_path(f, user_path); error =3D vfs_open(real_path, f); if (error) { @@ -68,7 +67,6 @@ struct file *backing_tmpfile_open(const struct file *user= _file, int flags, if (IS_ERR(f)) return f; =20 - path_get(user_path); backing_file_set_user_path(f, user_path); error =3D vfs_tmpfile(real_idmap, real_parentpath, f, mode); if (error) { diff --git a/fs/file_table.c b/fs/file_table.c index 8dcd213c0251..f9d1b5edd6ae 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -71,8 +71,8 @@ EXPORT_SYMBOL_GPL(backing_file_user_path); void backing_file_set_user_path(struct file *f, const struct path *path) { backing_file(f)->user_path =3D *path; + path_get(path); } -EXPORT_SYMBOL_GPL(backing_file_set_user_path); =20 #ifdef CONFIG_SECURITY void *backing_file_security(const struct file *f) --=20 2.53.0 From nobody Fri Sep 25 11:05:14 2026 Received: from mail-wr2-f12.google.com (mail-wr2-f12.google.com [74.125.225.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C99F4314B73 for ; Sun, 13 Sep 2026 14:49:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.76 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789310995; cv=none; b=oPa7AxbrB+PxmzkeP495bzZOknzOiwpnBPpMrM/c4KpSvJRjH6yLfkwOoWLVVvozzkLY1dmc9hXyJRuMhzaAXX20S4SFSFXCc2NvBargfo/3gvc14xp06V8J47ixWMKfyF3T9koOBkXl0LVoNCiuJHBnB+uJKXChtA323l6OdFg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789310995; c=relaxed/simple; bh=f/JGvyozr5jeaQuC/YPBC4EZWLzX+hOKaQnE0gOoXKk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VPzPm/WvMXJroJ+ZLGPrPcC7aa2eRuXfwJCrw9kdhdYB6sk6qT2t49wdk3vnJLX1RcUN/SSn8r61naAJWNaTXuEASuR9+joGjmiCx4Dw+J0IwITUmlIHEIsuKCCS97Jhu3VnSspRAJhl/JLBS+cnrcyS4Mmveu7YOwaur48KhHc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=WLsnFoPd; arc=none smtp.client-ip=74.125.225.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WLsnFoPd" Received: by mail-wr2-f12.google.com with SMTP id ffacd0b85a97d-482f6356256so369576f8f.1 for ; Sun, 13 Sep 2026 07:49:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789310992; x=1789915792; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=tEgrf0WZPqVqJ7RIhBAsuccBYx+nrV9P/xGJSXqzGyg=; b=WLsnFoPdjiVo7jSLN7mGOqSUrXSE9qV29lFGYkmpWo/b4TDWRWdSZ+bluJ4KyoS0oh GNyGyT3wrfynb8J2oR7XqcMWgoEdwoGGlp1V0sNJO7vkCD2kXWUVy7XYwOlPQhGoatMQ o8LeOBvcuGgBx4GUfgVJWyV2fjixcLwkP3XsDNZ7tsXI+AH1FzeHPkhbOgbTWPIyBk02 tdEfxI3UkhkajeODBnORJaUc1op+L+WDLh7EFbqe/g/PMVmzhV6bejAUQkfbCAqJXP7S XtKeV0t9eKgQIgSt44oicnVbdZvjLaL0P+lXn9/EqoRFa9Jp47BlDsHNfWP8HujH8nbI dXpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789310992; x=1789915792; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=tEgrf0WZPqVqJ7RIhBAsuccBYx+nrV9P/xGJSXqzGyg=; b=myRv3EGDccWij4xIwh4N71roXHit6qwhNFMOHFC0YhTl5UoEboAAeuqxa+F0tIgzVo 7DDvPh08+Q5FPBCSQwqrmglAtbgq0HGMHA4Q3QrYdT+zJedDhI4cXUce0ccuvKUy3B6B m+iT/X3ponNRy1lG4JahkFEdL1uVEFGJaMEjs44bFtzGSYgQqpr4/IlNbrlgevFvvnn7 rAwoiCta4TBuprGzSJzWJcfIQ94Isfu+r3TO9cMOQuwfIFe63arT5IBR1YpB11xel3KC BZWQK2PBceEpevipM62Ar9GRRw1bPaw2ML2jFzaWO9SNMNVqWflx3BT7jB6fb1MniNy+ xTXw== X-Forwarded-Encrypted: i=1; AKwUvBywrFIWGdR7rnPcW0vmj2qrfS6W7FmU6Ao/0uYlHXOR2JBto80lKoNPcnjmrPr6IZz+Vku3iP9jV6PzTMA=@vger.kernel.org X-Gm-Message-State: AFuF++lDTzDDIdxbs9vpebXfyJwmPt28UzP+l3MfVhGLzvVTZ+xV9Kqr UIkwIDd8R3BhK7GVX65THUfEE0+vUwHziQEQKyzxMM8NDtMLRtm71scM X-Gm-Gg: AYBFou0tjFC8J9/BhT6yi3LPJrqCZkthYEmwLFWVmPCDmxNqjj5e2LHOjKfSIjuSa+O vTYvUIK67DzNav6+91VyfRTcqaW4MghNyXuCRo/9HyQ+bIlRv/30Zh3Vncjc7r23VJ2kBaKHG44 660AQWgJOzwbcs3unu8jNRjqoWJiZT378yaHXAjTT9pxoE5Aa9M5j5Y005pL05CaPByyQ2Wn4XT WlIleMeOjRXWU4HC4HmmTEGTL0yFPXUDGk+A5/rYWGgpqzkAM7bH6kCZHWjboQbF+5P3isz2zhV WgxRplQDU69MhTdfceHgOHm8N47s2BZmYXMo2GQMKF4SjTAura6ebVR0NpGglYQnhF9TKp8eLwk XkiAugLCHp5WukdRWtbB9ZdjfUG5xCmfOMfmnmrByNmoUHxxjwlC4yHl9PQ2bTwHrqc0x/TTKY+ q5srdK0k9gA+4Kuxj8mjL4KSGNYwJZ09sD604qg9IBtnLKKOMYbIB+dts0w2NW8FsPHnG6K7adg Ieq3LhTBV2as8E/iHSOrQsY9/pKMb0FgxNmRywBVb0= X-Received: by 2002:a05:600c:5248:b0:49e:6865:904e with SMTP id 5b1f17b1804b1-49e76068364mr29300465e9.12.1789310991798; Sun, 13 Sep 2026 07:49:51 -0700 (PDT) Received: from f.. (cst-prg-84-1.cust.vodafone.cz. [46.135.84.1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e6420de77sm109534235e9.3.2026.09.13.07.49.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 07:49:51 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Mateusz Guzik Subject: [PATCH 02/10] fs: add path_create(), path_move() and path_clone() Date: Sun, 13 Sep 2026 16:49:09 +0200 Message-ID: <20260913144918.1606123-3-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260913144918.1606123-1-mjguzik@gmail.com> References: <20260913144918.1606123-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Signed-off-by: Mateusz Guzik --- fs/namei.c | 29 +++++++++++++++++++++++++++++ include/linux/path.h | 14 ++++++++++++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index ca4f5e3be99a..c8754c7ba8be 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -698,6 +698,35 @@ static __always_inline int lookup_inode_permission_may= _exec(struct mnt_idmap *id return security_inode_permission(inode, mask); } =20 +/** + * path_create - WRITEME + * @path: path to get the reference to + * @mnt: WRITEME + * @dentry: WRITEME + * + * Create a path object using the given vfsmount and dentry pair while inc= rementing + * the reference count on both. + */ +void path_create(struct path *path, struct vfsmount *mnt, struct dentry *d= entry) +{ + path->mnt =3D mntget(mnt); + path->dentry =3D dget(dentry); +} +EXPORT_SYMBOL(path_create); + +/** + * path_clone - WRITEME + * @path: path to get the reference to + * + * Given a path increment the reference count to the dentry and the vfsmou= nt. + */ +void path_clone(const struct path *src, struct path *dst) +{ + dst->mnt =3D mntget(src->mnt); + dst->dentry =3D dget(src->dentry); +} +EXPORT_SYMBOL(path_clone); + /** * path_get - get a reference to a path * @path: path to get the reference to diff --git a/include/linux/path.h b/include/linux/path.h index 7ea389dc764b..8a621e0e1921 100644 --- a/include/linux/path.h +++ b/include/linux/path.h @@ -10,8 +10,18 @@ struct path { struct dentry *dentry; } __randomize_layout; =20 -extern void path_get(const struct path *); -extern void path_put(const struct path *); +void path_create(struct path *, struct vfsmount *, struct dentry *); +void path_clone(const struct path *, struct path *); +void path_get(const struct path *); +void path_put(const struct path *); + +static inline void path_move(struct path *src, struct path *dst) +{ + dst->mnt =3D src->mnt; + dst->dentry =3D src->dentry; + src->mnt =3D NULL; + src->dentry =3D NULL; +} =20 static inline int path_equal(const struct path *path1, const struct path *= path2) { --=20 2.53.0 From nobody Fri Sep 25 11:05:14 2026 Received: from mail-wm2-f12.google.com (mail-wm2-f12.google.com [74.125.225.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD1FA326924 for ; Sun, 13 Sep 2026 14:49:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.140 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311000; cv=none; b=N9N1D2FylY+QRauxG7/X3lg2t0fkDpxirKD0DTTeHOAVPJIjjSMHuWa6wZqVXTRK61662ITFI3Vhzjs1pygNvAuEytXQ9QBZaqcT04XGUnLjRwk1ViS781+jfC07ezrO3ELcyyzl+8AAGphyO0C6nJl6WbDAbO5FDlp62dPIf0g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311000; c=relaxed/simple; bh=u8esOdOTfFzVCI5F3C0EbDh+10B+rPHpIkrnx3VBn7U=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Br+J6tktEslOeG6VrAuBh3dn0G4dVkqK5Oan1s+LLZ1Guy/2hEPYvRPTLsEDEXab/wBkQyLxh5uLhqwlpke3bC7AVCDXQZ9dF0300EYUQP/7vGF8GVunD/78AP9lZJW4iztzfiCb3k7aanerXrytZi/54lmeLO4t1iTw7fxPvhU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=l2Rg4rnc; arc=none smtp.client-ip=74.125.225.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="l2Rg4rnc" Received: by mail-wm2-f12.google.com with SMTP id 5b1f17b1804b1-49ccff31419so9663605e9.3 for ; Sun, 13 Sep 2026 07:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789310994; x=1789915794; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=9jwIeBJauvU7aEOo2TsAcRg29a4SIp+GcLjXkxP9CcM=; b=l2Rg4rnc9ynki09cRof5KOW5MpHUgwaurdfXxjEaf590/iKfXH1K7dx2enZFxdaFIC NgYYSeD9ztQvLGb7GM5F+UfcLWO3CX+fpNbyLSZUtFVCpDMxaX3jhWEMzKd2TamFjAPc ubscxUycfgG+vuSEBQaBLD2C/vZtJS8bA/K8C/ln9ENaClBs8WxqTLM/lASyNny8lHg2 bClzwkDkQL+eVZidk8XAoSATU+YqIzw91LZI3E74o1mqFVy6ZkOURtt4Ssd9IrpVYOkK XzTkBzWSz9oRgYhNU6TOnuoObRDyaEJZi4iLBpoeyXETwPOhkgA/MozlOmO4EUFRzK+v SYLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789310994; x=1789915794; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=9jwIeBJauvU7aEOo2TsAcRg29a4SIp+GcLjXkxP9CcM=; b=TCIB59CkbGZ93TKPx8FfVZZH7zWkLhgtxqWTtygp4JdjaBJo7bK1Lmtjgg+BBFOgoI 99l1kz/9Hc6mG+K9YK3cc/FGHfu6gqq+HKvyKTjyseD8HDpYQZZnL+4nCnyM/dusfm3t t/XbkAtFx6NaDpFA7pV4PdbWiQ39cDyyRjqAjhhLSt9M5rYCyV/o1UGSUD0Ra6TltmDw FfI9Bc+8zWlmmEYYp8SzhBmB5X4zkKrANEcqM794MPIATmarayS9eFMD9uL1EQKGS9Dg dgtP30qxffIxixKSuQmWCRcoq4dla66q9pOWOjERD/nSjIJFa9hMB7cwZwCbi12xC5rH AhUQ== X-Forwarded-Encrypted: i=1; AKwUvBw2f0CNDLI1eDIICi5nlpZhrIndNtFcKKRVNzjplUIurDSraHPhh6WyyydrpHsrOcIoDL6Mh6XstjzdNBQ=@vger.kernel.org X-Gm-Message-State: AFuF++mllAeIchl4Ds9zrI9J9V++qmDD/EPFVFeYZcV9pJcrtpFsIMGe SwjDYk0DZTUW2yRK7VfFwBqvE1HHiYWkBAFhV9etkJdr2fY6RsiOyRKt X-Gm-Gg: AYBFou1g6x/0uF8gOaxGiiSuAv8KeKK7kpx2HBpTMlrKCzX7uPVp15UQaJBQfPs31+b K7RdvhPnBq29xhKj/MAq/1ktAMQ0TwZ2SEcL/3gZy4ZU7IaHOtTsdumr1XDJCXG+fKweSTREke6 ksQSDwc8PUji/y1dxPrwnYrc6BVzo9ESZlkLVFTgHDBB/KuB1RIMBIhGp3ib8Hve0qEavMJtOiT UKDMA+e4WVGxQvKDXh7B2nvxvFY+wAP12SyXp7Q0DNaGYV3DEWTOf/7eaLuzJC4mLFRa2maBMfD Llj/+yni3ifn72odB4pHVISSTyBVxe9ODcCVinv9VIzVA7YoEd09u5OV5z5YMWFrt8KR5HvIx6X MACuu89OuncgKhiU9jAg1JHpkdLzAlzR7PI84JyYZwX79UzvsjNjR3RtKrVX1Oi+IYfRAew/hRm UoQEEqISPVp1yOvVUHHhEbQQ/3Q13k4BBBBVKJLFz89/YL8lurNmiVOneUnV+nx8lsJgzR2WB7O P9ZFp//kSSrRJlFNOj+h5Pw1Am21UFiKo5NGYe/PqM= X-Received: by 2002:a05:600c:3491:b0:49c:cee0:f383 with SMTP id 5b1f17b1804b1-49e6cbfc8c1mr64395435e9.16.1789310993998; Sun, 13 Sep 2026 07:49:53 -0700 (PDT) Received: from f.. (cst-prg-84-1.cust.vodafone.cz. [46.135.84.1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e6420de77sm109534235e9.3.2026.09.13.07.49.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 07:49:53 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Mateusz Guzik Subject: [PATCH 03/10] fs: use path_clone() in path_init() Date: Sun, 13 Sep 2026 16:49:10 +0200 Message-ID: <20260913144918.1606123-4-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260913144918.1606123-1-mjguzik@gmail.com> References: <20260913144918.1606123-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" No functional changes. Signed-off-by: Mateusz Guzik --- fs/namei.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/fs/namei.c b/fs/namei.c index c8754c7ba8be..11937cfa8c7f 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -2745,13 +2745,13 @@ static const char *path_init(struct nameidata *nd, = unsigned flags) struct inode *inode =3D root->d_inode; if (*s && unlikely(!d_can_lookup(root))) return ERR_PTR(-ENOTDIR); - nd->path =3D nd->root; nd->inode =3D inode; if (flags & LOOKUP_RCU) { + nd->path =3D nd->root; nd->seq =3D read_seqcount_begin(&nd->path.dentry->d_seq); nd->root_seq =3D nd->seq; } else { - path_get(&nd->path); + path_clone(&nd->root, &nd->path); } return s; } @@ -2801,23 +2801,23 @@ static const char *path_init(struct nameidata *nd, = unsigned flags) if (*s && unlikely(!d_can_lookup(dentry))) return ERR_PTR(-ENOTDIR); =20 - nd->path =3D fd_file(f)->f_path; if (flags & LOOKUP_RCU) { + nd->path =3D fd_file(f)->f_path; nd->inode =3D nd->path.dentry->d_inode; nd->seq =3D read_seqcount_begin(&nd->path.dentry->d_seq); } else { - path_get(&nd->path); + path_clone(&fd_file(f)->f_path, &nd->path); nd->inode =3D nd->path.dentry->d_inode; } } =20 /* For scoped-lookups we need to set the root to the dirfd as well. */ if (unlikely(flags & LOOKUP_IS_SCOPED)) { - nd->root =3D nd->path; if (flags & LOOKUP_RCU) { + nd->root =3D nd->path; nd->root_seq =3D nd->seq; } else { - path_get(&nd->root); + path_clone(&nd->path, &nd->root); nd->state |=3D ND_ROOT_GRABBED; } } --=20 2.53.0 From nobody Fri Sep 25 11:05:14 2026 Received: from mail-wm2-f12.google.com (mail-wm2-f12.google.com [74.125.225.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A75F82DCF61 for ; Sun, 13 Sep 2026 14:49:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.140 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311001; cv=none; b=dDWPouubcpNwIzHZ8Gdn9pc0ENsv01bF7FkURpogubdqTDI7QxsArw799ZFh6C3edNVeEVfezjPu+gqgj8y9WSgIbpABx62/24TdzqZrt2R8x6DRudEqR5UxaRFisHo5jFByHRk5SXigNjWjBUfSP7Gta8XKThWdVfm87F+QfUk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311001; c=relaxed/simple; bh=6HyMqfMFokSBSd/H8EjZ1pGgrmb3gmjQfy+uT6NpeHU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mU8nCD+uwd/HnrgS5g4H8Z15UlVAXc7zJNlo9xqM3cdaz6JbQEGzyl/I/ob8THba/QpIwXM7jewLn0AwG9HzIBw2xlRTqbV3JM8xm8y9zKnLLRlVuvflcnO27YV2vU1Fiyk+9eTqtrXFFlAiLodyQJB0/XvA6EoXxndI2WyDt5U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PQ+GEZuo; arc=none smtp.client-ip=74.125.225.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PQ+GEZuo" Received: by mail-wm2-f12.google.com with SMTP id 5b1f17b1804b1-49b912d8239so6377985e9.0 for ; Sun, 13 Sep 2026 07:49:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789310996; x=1789915796; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=lbZdzHZQeGskIxjajRcW6RuRmFa63C0BNSbgSO/ZyFE=; b=PQ+GEZuoV6QQXoBLvpY3WhXEj3FKURHLeXmUo0LbyEd55raaviJoBT8spI8CJ+Utkv aTuxkjwfCK10a1zK915+pWqa2pAUMsFTL2R/G9oGTPvRuRkmevHGuLLarN/rvfxlNcEj i3gji+kdOXdvJSrCY53/rnGPL+yvL/auyDtNr2E+2Rv2riJlaSTbR2j3rWrbxgwYZPKA bCADzzp1kDCFstJBAOtbklv4ilwPcfGmHvOBcO4OVAlr/Cv4UY8GAYr+9WCh/mwK65ov MVYHpK8GKMNh/P46Xy9EDnzIwIb+/ayj506nGoVwjg1QaDxaGwH7wH6gU1vldb2a3ed6 hC6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789310996; x=1789915796; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=lbZdzHZQeGskIxjajRcW6RuRmFa63C0BNSbgSO/ZyFE=; b=Gc6HAL2o6yuFHt0hTCORMfAcpGSEbVNB5kJht5ZGF5cU3QgkCr4jLPl8BJckfEg8xN xSBo7M6UUJdUjYsDCsfXkWnubLONjezGJHZ8CqlXuPr+4c9vL+g3LAHe0ew0n3A9OHrw eIrQzxGRxyxfO/lVdFy3gzm5ZwHli+NuWD50RBxC5xJwKILyi9WGxZdOPJZoXoIX5D8m 9AyUSYmzYpuSTx5k+FJbIWSzrnyCWw95nyGQfW8HJ5D/4EDofinZNG7vj4lneWhwSUSn 0QbSh4oPtz05aHNv3CLeSXPi7HeMDQZ0fAy4L2yHVsPvSSpNdZVBPfCVPgBxfnT2tr2E uD0g== X-Forwarded-Encrypted: i=1; AKwUvBz/AQq9cmmmRTZ3a8r0IEwnEYZXuHBVseJU/7e8pJEZ52EsgxRzUgFRRSGeDn0yNvfPFMJC4Q5trYF8BhQ=@vger.kernel.org X-Gm-Message-State: AFuF++npUojgArhOQ2XQkrj49XfU1TVfz9Q6kV5yYe0URrKOLXUXgWhF M9kvAh08NQEi7HP2ldIxHPo1dWi3UK9Y+pTC8UulHcYGRt2QnZMcAStxs376PA== X-Gm-Gg: AYBFou16T5greic2yAztEaMazR5lKZYRrQ6C++4kKFLrbIz6Sm7jXJqvHLMZuzXkOud 5UDTJWcUXmTJu0gltv5SL7T1EyTzCj3vCl3Uv6VwKL0Ye6vc9x+b7FDN3h9kIwr+euIcUwTqp/d 47cWM4uCZPNgVWT21B/eAC///29cD8pAn+z6gkq8tIpilFzTcpy7lXXkBX7mbPOEcbNsUMeShNN xwubH8PIQ+Ftxf7tmlmWZs9GxIYAysDyB0sXh6SVgsBGuVmeorHIohAhVpvvDFybFxmY1V47FT9 NiZYbpvPOOGqhLNh65Bh5qDqqiGBEjF9hllDyZ3W1BvX4+N4gk+cVRjE9FCmeYniWjLRNi25UAN KJNBTN6M9WkE8YaJKkVOH4fR5ukBbsXc4jXg+JNRZJu67dIOBZtfZOPqJhg1eTvgWhM7WDyjljJ Q/wRXqfgETb4cVyS/tSBgz3Q0Sfc0Vc7VU0F/JS0wq6FYS+iN/Uolfd8Mm5DU9HuV4GuIz6kP6U fudlDw57dcliILlf//l/eJFVsO3TukrAOSFeBFWggmXAXmt6O5a3Q== X-Received: by 2002:a05:600c:3594:b0:49c:fa21:1c89 with SMTP id 5b1f17b1804b1-49e6cc14055mr86517875e9.30.1789310995731; Sun, 13 Sep 2026 07:49:55 -0700 (PDT) Received: from f.. (cst-prg-84-1.cust.vodafone.cz. [46.135.84.1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e6420de77sm109534235e9.3.2026.09.13.07.49.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 07:49:55 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Mateusz Guzik Subject: [PATCH 04/10] fs: use path_clone() and path_move() in vfs_open* Date: Sun, 13 Sep 2026 16:49:11 +0200 Message-ID: <20260913144918.1606123-5-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260913144918.1606123-1-mjguzik@gmail.com> References: <20260913144918.1606123-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" No functional changes. Signed-off-by: Mateusz Guzik Reviewed-by: Jan Kara --- fs/open.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/fs/open.c b/fs/open.c index a84b55301719..e11d1342ff74 100644 --- a/fs/open.c +++ b/fs/open.c @@ -1102,8 +1102,7 @@ int vfs_open(const struct path *path, struct file *fi= le) { int ret; =20 - file->__f_path =3D *path; - path_get(&file->f_path); + path_clone(path, &file->__f_path); ret =3D do_dentry_open(file, NULL); if (!ret) { /* @@ -1125,9 +1124,7 @@ int vfs_open_consume(struct path *path, struct file *= file) { int ret; =20 - file->__f_path =3D *path; - path->mnt =3D NULL; - path->dentry =3D NULL; + path_move(path, &file->__f_path); ret =3D do_dentry_open(file, NULL); if (!ret) { fsnotify_open(file); --=20 2.53.0 From nobody Fri Sep 25 11:05:14 2026 Received: from mail-wm2-f12.google.com (mail-wm2-f12.google.com [74.125.225.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B9A222E738F for ; Sun, 13 Sep 2026 14:49:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.140 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311001; cv=none; b=HQNlsPSkBIj9zkFuQwa8St0WolAgaQ9fOVlfNErEce2o/sL3vcX22dZPouF8GRDfoXgni+qbayTKZAin7a+Lcu/MDMm5IYvzYmCvOkUqnT4zXhEQgCtbv7QALlHAO1m2sWvsVtpIOzmn48fnyeHKeYoSzcMabHW8c3mM55MjCTs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311001; c=relaxed/simple; bh=LubrbMnxIKnN7lBVtvVGlZxjV+CpntlE18ShoqLWK+4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aq21kaWAcMCzVNb4HF0ld7TcWpMxm3CwzSJjAUJqEUso+uCAHZt8waEumpCnu0FFcJsQKtUE45IgfVFSVMV00pzjM160nbRnAYlfzif6rfr33T+4A4uLoOo42ljtI3xuLWGeNS/ESH0l3+IBo5kOwwa13CtAvNMQr3cjHXSIV10= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=rS0/MFLW; arc=none smtp.client-ip=74.125.225.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rS0/MFLW" Received: by mail-wm2-f12.google.com with SMTP id 5b1f17b1804b1-49e66390995so5149205e9.2 for ; Sun, 13 Sep 2026 07:49:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789310998; x=1789915798; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=afPZZL7err8emUCp6Hyuu5QUo4GAQSFPzGqL5FJ8ZIg=; b=rS0/MFLWDopHFHUzo5HE+aWhwaVj+vUa8JayLN+PCNMBXHJyZxUz1Z9b43v/Z9Eze1 uf//V08WJyfEhVQZ+sgHmHtGH+OG4OweFteYhpH44nRfYeZORJHOs5foa1fwAgrEszYU OEHcpHM6cdoDlIg+nHI/DDN7FkHmtv2PtStVoroLsygH/ay1I9q4krLbpJGvzJYsiPaj 7jDF5zvk/QTE5on+eSQX3R1tW483mB+JVYFF3nNve2pfq60FLwXZdU2DJlve3xACqCwT +UqcH10a7M93Zbege5UcH/ypVq/OmX3CMBAfEjtwFZJLwHymjeQpJkBUwDwzK8WIW6qd yASA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789310998; x=1789915798; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=afPZZL7err8emUCp6Hyuu5QUo4GAQSFPzGqL5FJ8ZIg=; b=gmy8odeUZz24bLGTqn/Qq7pt6Laj+/N10WVsHOgPQR789evkTaauWFHwLXfNJ04GT3 uCITC0JcdMpFEOhCdzo26pnOOSOTVP4aPVW/TpxD/Na1nnNxktxSLCoUpJddLtroTBj2 T/xSR+roQGGM1InHDNQS9fs4uhOjc357fxAsCKEwjPjWTXOJO+h063AEYvEYAIhcdd8k C35f4WeDg7Sj/+IyCGYC1R6PkRtm0a40+DON1WnKk6A3TPoBU7Y7GNVSiU14/FXgDWhK feXqO1Jo7RB4qq34QVnmiSJpRj38zNbt5ErTwRzx9l0uc2pnEwUHymqnM12IhkeezGh2 9CYg== X-Forwarded-Encrypted: i=1; AKwUvBwZQ4BxbogiF0Ky27dj+rZHOzDHUdgjuKJm15iyugjHYhRvBA+J8dpaD+dk32tkfGx8rn5JNC35LuPwc5c=@vger.kernel.org X-Gm-Message-State: AFuF++kB7aacpJ+/eNlt1+4k5XXfkq+aqd5yXLMPHCnIBJBHCeMvdyH4 rwNC0FNmiG2ViPMCmSp7ME9FWQ29qLgOhVO7O0VFwxwl/S2dlxOFyPF3 X-Gm-Gg: AYBFou2SVjtJZ5k8JkSYC7ucqCRMMJ3MEGmOX9q0KWqEdktzIcU1d3rRS/6NfXmV9/W OA3QbUt83Dfi/RvSQH5mNuPfh4wyqex8e4oMXcL0ugQWtIXb18HbmiY37pEnKXIxtRfoRjygAYG oJkLPVZ803PEfl0E1XZ/rlM1ObnmQmKs0QNrHmk3gYrOq9cilNdZ65JDvWK01tOZtOG5ulgXERr /hY3+ZAI76NfLrHRduMG4pM/hPa2j1rGP9iA7CKReEbOQ1/D/uZwRz6sAn27J8c3N1WCb0K2lV5 3exhNOhqqxhxCIJFwTfgn+bnmnQMnD/J6MpseMmrYX4mtaFo2DVAdSQ2QEyS/vso2Kfkv1L8aks EQ6kylI4JAAn5umb+YCM7/YpQgG0+1X539lrcdcjsG2szed0EGgy82VoMNvLSKXyrMDjCB/bLM1 AdlsuDfrSqbVQ9xa6WSHAHfpSuH5MHiOmL00fLMhvgNBn+Bgox/8Uskidg4IIZvtXEx4Yq0Ny9h vAxWsxBj15VQBdPmRRRjS+MKGv255yKYXCDm2N8sCs= X-Received: by 2002:a05:600c:3ba5:b0:49b:8f18:714a with SMTP id 5b1f17b1804b1-49e6caad1a5mr80018295e9.12.1789310997702; Sun, 13 Sep 2026 07:49:57 -0700 (PDT) Received: from f.. (cst-prg-84-1.cust.vodafone.cz. [46.135.84.1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e6420de77sm109534235e9.3.2026.09.13.07.49.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 07:49:56 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Mateusz Guzik Subject: [PATCH 05/10] fs: use path_clone() in backing_file_set_user_path() Date: Sun, 13 Sep 2026 16:49:12 +0200 Message-ID: <20260913144918.1606123-6-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260913144918.1606123-1-mjguzik@gmail.com> References: <20260913144918.1606123-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" No functional changes. Signed-off-by: Mateusz Guzik Reviewed-by: Jan Kara --- fs/file_table.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/fs/file_table.c b/fs/file_table.c index f9d1b5edd6ae..0dca0c6c991f 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -70,8 +70,7 @@ EXPORT_SYMBOL_GPL(backing_file_user_path); =20 void backing_file_set_user_path(struct file *f, const struct path *path) { - backing_file(f)->user_path =3D *path; - path_get(path); + path_clone(path, &backing_file(f)->user_path); } =20 #ifdef CONFIG_SECURITY --=20 2.53.0 From nobody Fri Sep 25 11:05:14 2026 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BE8CD314D05 for ; Sun, 13 Sep 2026 14:50:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.43 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311006; cv=none; b=aHHsSPXvyxgrtq8LAxExHWsJ5A6gyi1PyCCg96/eylOrHs13xqAahK7vtE8PA59QJB23lSQKcnpSJqdvnSq6bZ2k2yiE+lrocQp04tfROz5OXkPkSgWoVOqPyeEzg2ZRYmSTPdMrhbF9kzfN0eRMLrD3pvG5PoV6iGG0gMdX2Mg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311006; c=relaxed/simple; bh=IBG2yfLzXGLsx3b/Ek1Ca8rr1SVh+H8bpvha5uJJBLU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=C+ZTkiKAdMgOv2yx9H6HIHOWGC86SZKrIFJT6OqkdFDP9ZV4yklrm2pwv2oL0ddLQgPvwJqn2+lbtKioAeXhdXzG7Savs73gAPiw2nIlKi3GEzv36y+PCqYm+BSf/Q59V0ou3jgpNoartMe5PI9X4qFWinNPg1KTIQ986VVKsT4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VT7zzk4f; arc=none smtp.client-ip=209.85.128.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VT7zzk4f" Received: by mail-wm1-f43.google.com with SMTP id 5b1f17b1804b1-49d0da752ffso30534105e9.3 for ; Sun, 13 Sep 2026 07:50:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789311000; x=1789915800; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=dZ6sPJRJ6750EeDP6ag0yW3GyGNXKx/hcY4+42nnWbk=; b=VT7zzk4fCrTre5mOZr/Jf7lTVpKm4lEU8TN/yxdHue6v8JiiLQKOQV1ps5eLZ3PJRw F2zUYv4O1BWVvSk7wJIA21yYxLbHHJG4MwLaY2iOu/TdDE9y34fqwi3gcxjW+p/HYhUV Hv+QaQFt3DGvr8sUzf2mbqHaGfIBgnQQ6nB6V46Ft/wefPR5ey+XxEuLhicYbDZkVUVb E46CISXTls87i+nWACe09tNuEamKKVvPvVOLXXSrEPjO5EY9PInEkIfo7TFssEeLIXfM Z8kS7su/yzF1nBNQkZ60I1nRmgDCcbFIkPKg9ksPGaH3KhzDwTrH1eto/A2oBn5XLgKT zVIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789311000; x=1789915800; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=dZ6sPJRJ6750EeDP6ag0yW3GyGNXKx/hcY4+42nnWbk=; b=AlGF77DY6C1hYvqSkEpOjNa8wCiMA22uJ2YLvMubsqWgf1iTN1/Pg8sqafwSNb7u3c 7sjNQiVWR1bD6ci4E6g7PWBAf8p3Wx7i46JAUx64+0LgttX7u3CKkx12VM1u+T9rlogd 99Pk3FVlDIgXPmIbEtC2WeyCPh0m19A96qfWFEjpvyyU7kTWJdUvTMKfOVLkyAerUNoE iL9zPoHFsI1aGJaYLDJM3dJMbunOAMMEnXEomz8inFNZpPimujSlBakoqB382/TCuUG7 ehUUnFHPsri8tXPwpcBm3oPN+lx0+t7vw1i/vQZTbUyfbJDVWc3qIgwWi4eVtE6fOT6E dyYg== X-Forwarded-Encrypted: i=1; AKwUvBxspQkPUKKFvZi5WOsAPD045rxBdRURtolbVeds95yqpFjpBybMZdlhLsYjxV6sxuTKSG6K+Qe3thlhH8g=@vger.kernel.org X-Gm-Message-State: AFuF++lTP14/4zO66iU+m6+cy2hUAi10fJKqHk/Eok2dOHViIrpZnDyy u6UjsYoyHK0WhJ1EUh//bz/U0boH5Dpb4gHBMGO62qv7CjAoh+Td5aWH X-Gm-Gg: AYBFou1z3tYkwM3+eoXwUsEdg4Hw/qcRxWmqGr6ZDd878AfHTTwGug7MVkV6Rhx6rnp tXkOAizNLB7ZrG78ZQbiNnaGgJvkB00ieDHC13huREz6FHXg7gq+67VeaAh6pfLI/w7Dd51Gl/B kRP54oZMh5FCXpvzmB//2kdqQYHxYFJkZ0dT/ghnwoftpmOAzYGRh+JPmeQjhrN5J0fhTiXFp6S 0EKSxfqtzF/ktkD65izHWfIXKz8iPUtvtRlzoftnp6/d865BXqAzuuvCCaJwvb9GylvBR6/1eZx kD2acEPtXtBj8exGJhqhENaBkUPfmQQIpdupm65mjBwhCQ5t8+/Kafjo8QqdBW04ZrHi9CKLyJV 47ftveeYAZ3IlUW0ANIqyDW45b6K1V8IxNp0MqxTFLGf0qWfjcZiaGhBNaSrqogqVH+Uk5izICu YEm2ZEJvfUlvGLUJcGeYgRMM4YTX/EeAlzuUude52qoRiQ8Jm9GB1Sc/n/KXusgNj66bfjYYzli er9K8jk73Av+gSpUxX66GN+MAyNYXR64JoJ5F8CpoI= X-Received: by 2002:a05:600c:3b8c:b0:49e:73d3:78ab with SMTP id 5b1f17b1804b1-49e73d379e4mr63651815e9.0.1789310999832; Sun, 13 Sep 2026 07:49:59 -0700 (PDT) Received: from f.. (cst-prg-84-1.cust.vodafone.cz. [46.135.84.1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e6420de77sm109534235e9.3.2026.09.13.07.49.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 07:49:59 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Mateusz Guzik Subject: [PATCH 06/10] Coccinelle-based conversion of path_* consumers to use the new primitives Date: Sun, 13 Sep 2026 16:49:13 +0200 Message-ID: <20260913144918.1606123-7-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260913144918.1606123-1-mjguzik@gmail.com> References: <20260913144918.1606123-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" No functional changes. The script: @@ expression src, dst; @@ - *dst =3D *src; - path_get(dst); + path_clone(src, dst); @@ expression src, dst; @@ - *dst =3D src; - path_get(dst); + path_clone(&src, dst); @@ expression src, dst; @@ - dst =3D src; - path_get(&dst); + path_clone(&src, &dst); @@ expression src, dst; @@ - *dst =3D src; - path_get(src); + path_clone(src, dst); @@ expression src, dst; @@ - path_get(&src); - *dst =3D src; + path_clone(&src, dst); Signed-off-by: Mateusz Guzik Reviewed-by: Jan Kara --- drivers/block/loop.c | 3 +-- fs/autofs/dev-ioctl.c | 3 +-- fs/devpts/inode.c | 6 ++---- fs/failfs.c | 3 +-- fs/fhandle.c | 3 +-- fs/file_attr.c | 6 ++---- fs/fs_struct.c | 6 ++---- fs/namei.c | 3 +-- fs/namespace.c | 3 +-- fs/notify/fanotify/fanotify_user.c | 3 +-- fs/nsfs.c | 3 +-- fs/open.c | 3 +-- fs/overlayfs/params.c | 3 +-- fs/pidfs.c | 3 +-- fs/proc/base.c | 3 +-- fs/smb/server/vfs.c | 3 +-- fs/xfs/xfs_handle.c | 3 +-- kernel/trace/bpf_trace.c | 3 +-- security/apparmor/task.c | 3 +-- security/keys/big_key.c | 3 +-- security/landlock/fs.c | 3 +-- security/landlock/syscalls.c | 3 +-- 22 files changed, 25 insertions(+), 50 deletions(-) diff --git a/drivers/block/loop.c b/drivers/block/loop.c index 758c20678bf6..cc5c11c57989 100644 --- a/drivers/block/loop.c +++ b/drivers/block/loop.c @@ -1321,8 +1321,7 @@ loop_get_status(struct loop_device *lo, struct loop_i= nfo64 *info) memcpy(info->lo_file_name, lo->lo_file_name, LO_NAME_SIZE); =20 /* Drop lo_mutex while we call into the filesystem. */ - path =3D lo->lo_backing_file->f_path; - path_get(&path); + path_clone(&lo->lo_backing_file->f_path, &path); mutex_unlock(&lo->lo_mutex); ret =3D vfs_getattr(&path, &stat, STATX_INO, AT_STATX_SYNC_AS_STAT); if (!ret) { diff --git a/fs/autofs/dev-ioctl.c b/fs/autofs/dev-ioctl.c index 6743b3b64217..a2ec9659297f 100644 --- a/fs/autofs/dev-ioctl.c +++ b/fs/autofs/dev-ioctl.c @@ -200,8 +200,7 @@ static int find_autofs_mount(const char *pathname, while (path.dentry =3D=3D path.mnt->mnt_root) { if (path.dentry->d_sb->s_magic =3D=3D AUTOFS_SUPER_MAGIC) { if (test(&path, data)) { - path_get(&path); - *res =3D path; + path_clone(&path, res); err =3D 0; break; } diff --git a/fs/devpts/inode.c b/fs/devpts/inode.c index 9844dcf354ee..2b5d273edaa7 100644 --- a/fs/devpts/inode.c +++ b/fs/devpts/inode.c @@ -152,8 +152,7 @@ struct vfsmount *devpts_mntget(struct file *filp, struc= t pts_fs_info *fsi) struct path path; int err =3D 0; =20 - path =3D filp->f_path; - path_get(&path); + path_clone(&filp->f_path, &path); =20 /* Walk upward while the start point is a bind mount of * a single file. @@ -184,8 +183,7 @@ struct pts_fs_info *devpts_acquire(struct file *filp) struct path path; struct super_block *sb; =20 - path =3D filp->f_path; - path_get(&path); + path_clone(&filp->f_path, &path); =20 /* Has the devpts filesystem already been found? */ if (path.mnt->mnt_sb->s_magic !=3D DEVPTS_SUPER_MAGIC) { diff --git a/fs/failfs.c b/fs/failfs.c index 66a36da3d236..6459163de5b8 100644 --- a/fs/failfs.c +++ b/fs/failfs.c @@ -13,8 +13,7 @@ static struct path failfs_root_path =3D {}; =20 void failfs_get_root(struct path *path) { - *path =3D failfs_root_path; - path_get(path); + path_clone(&failfs_root_path, path); } =20 bool failfs_mnt(const struct vfsmount *mnt) diff --git a/fs/fhandle.c b/fs/fhandle.c index f8829231e3d7..5c29a0a36c57 100644 --- a/fs/fhandle.c +++ b/fs/fhandle.c @@ -173,8 +173,7 @@ static int get_path_anchor(int fd, struct path *root) CLASS(fd, f)(fd); if (fd_empty(f)) return -EBADF; - *root =3D fd_file(f)->f_path; - path_get(root); + path_clone(&fd_file(f)->f_path, root); return 0; } =20 diff --git a/fs/file_attr.c b/fs/file_attr.c index bfb00d256dd5..0a46fe39dfc7 100644 --- a/fs/file_attr.c +++ b/fs/file_attr.c @@ -402,8 +402,7 @@ SYSCALL_DEFINE5(file_getattr, int, dfd, const char __us= er *, filename, if (fd_empty(f)) return -EBADF; =20 - filepath =3D fd_file(f)->f_path; - path_get(&filepath); + path_clone(&fd_file(f)->f_path, &filepath); } else { error =3D filename_lookup(dfd, name, lookup_flags, &filepath, NULL); @@ -464,8 +463,7 @@ SYSCALL_DEFINE5(file_setattr, int, dfd, const char __us= er *, filename, if (fd_empty(f)) return -EBADF; =20 - filepath =3D fd_file(f)->f_path; - path_get(&filepath); + path_clone(&fd_file(f)->f_path, &filepath); } else { error =3D filename_lookup(dfd, name, lookup_flags, &filepath, NULL); diff --git a/fs/fs_struct.c b/fs/fs_struct.c index 34699f3b6f88..330a15516787 100644 --- a/fs/fs_struct.c +++ b/fs/fs_struct.c @@ -120,10 +120,8 @@ struct fs_struct *copy_fs_struct(struct fs_struct *old) fs->umask =3D old->umask; =20 read_seqlock_excl(&old->seq); - fs->root =3D old->root; - path_get(&fs->root); - fs->pwd =3D old->pwd; - path_get(&fs->pwd); + path_clone(&old->root, &fs->root); + path_clone(&old->pwd, &fs->pwd); read_sequnlock_excl(&old->seq); } return fs; diff --git a/fs/namei.c b/fs/namei.c index 11937cfa8c7f..44fd82ee45c2 100644 --- a/fs/namei.c +++ b/fs/namei.c @@ -1182,8 +1182,7 @@ static int nd_jump_root(struct nameidata *nd) return -ECHILD; } else { path_put(&nd->path); - nd->path =3D nd->root; - path_get(&nd->path); + path_clone(&nd->root, &nd->path); nd->inode =3D nd->path.dentry->d_inode; } nd->state |=3D ND_JUMPED; diff --git a/fs/namespace.c b/fs/namespace.c index a36ea2cc733d..79f785fabfdc 100644 --- a/fs/namespace.c +++ b/fs/namespace.c @@ -4614,8 +4614,7 @@ SYSCALL_DEFINE5(move_mount, if (fd_empty(f_to)) return -EBADF; =20 - to_path =3D fd_file(f_to)->f_path; - path_get(&to_path); + path_clone(&fd_file(f_to)->f_path, &to_path); } else { lflags =3D 0; if (flags & MOVE_MOUNT_T_SYMLINKS) diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanoti= fy_user.c index 63c9759fc3b0..3c49329543d9 100644 --- a/fs/notify/fanotify/fanotify_user.c +++ b/fs/notify/fanotify/fanotify_user.c @@ -1202,8 +1202,7 @@ static int fanotify_find_path(int dfd, const char __u= ser *filename, !(S_ISDIR(file_inode(fd_file(f))->i_mode))) return -ENOTDIR; =20 - *path =3D fd_file(f)->f_path; - path_get(path); + path_clone(&fd_file(f)->f_path, path); ret =3D 0; } else { unsigned int lookup_flags =3D 0; diff --git a/fs/nsfs.c b/fs/nsfs.c index c3b6ae76594a..577c9edcea32 100644 --- a/fs/nsfs.c +++ b/fs/nsfs.c @@ -29,8 +29,7 @@ static struct path nsfs_root_path =3D {}; =20 void nsfs_get_root(struct path *path) { - *path =3D nsfs_root_path; - path_get(path); + path_clone(&nsfs_root_path, path); } =20 static long ns_ioctl(struct file *filp, unsigned int ioctl, diff --git a/fs/open.c b/fs/open.c index e11d1342ff74..fc602c44b3bc 100644 --- a/fs/open.c +++ b/fs/open.c @@ -653,8 +653,7 @@ SYSCALL_DEFINE2(fchroot, int, fd, unsigned int, flags) if (!ns_capable(current_user_ns(), CAP_SYS_CHROOT)) return -EPERM; =20 - path =3D fd_file(f)->f_path; - path_get(&path); + path_clone(&fd_file(f)->f_path, &path); } =20 error =3D security_path_chroot(&path); diff --git a/fs/overlayfs/params.c b/fs/overlayfs/params.c index c93fcaa45d4a..0c72e18dd625 100644 --- a/fs/overlayfs/params.c +++ b/fs/overlayfs/params.c @@ -474,8 +474,7 @@ static int ovl_parse_layer(struct fs_context *fc, struc= t fs_parameter *param, if (!buf) return -ENOMEM; =20 - layer_path =3D param->file->f_path; - path_get(&layer_path); + path_clone(¶m->file->f_path, &layer_path); =20 layer_name =3D d_path(&layer_path, buf, PATH_MAX); if (IS_ERR(layer_name)) diff --git a/fs/pidfs.c b/fs/pidfs.c index a6a643f15d08..c70a997376bd 100644 --- a/fs/pidfs.c +++ b/fs/pidfs.c @@ -42,8 +42,7 @@ static struct simple_xattr_cache pidfs_xa_cache; =20 void pidfs_get_root(struct path *path) { - *path =3D pidfs_root_path; - path_get(path); + path_clone(&pidfs_root_path, path); } =20 enum pidfs_attr_mask_bits { diff --git a/fs/proc/base.c b/fs/proc/base.c index 0f9efd25bb05..01d8bfe1c410 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2253,8 +2253,7 @@ static int map_files_get_link(struct dentry *dentry, = struct path *path, rc =3D -ENOENT; vma =3D find_exact_vma(mm, vm_start, vm_end); if (vma && vma->vm_file) { - *path =3D *file_user_path(vma->vm_file); - path_get(path); + path_clone(file_user_path(vma->vm_file), path); rc =3D 0; } mmap_read_unlock(mm); diff --git a/fs/smb/server/vfs.c b/fs/smb/server/vfs.c index 3a6f3139c6f5..c81b97a7356a 100644 --- a/fs/smb/server/vfs.c +++ b/fs/smb/server/vfs.c @@ -1349,8 +1349,7 @@ int __ksmbd_vfs_kern_path(struct ksmbd_work *work, ch= ar *filepath, path_len =3D strlen(filepath); remain_len =3D path_len; =20 - parent_path =3D share_conf->vfs_path; - path_get(&parent_path); + path_clone(&share_conf->vfs_path, &parent_path); =20 while (d_can_lookup(parent_path.dentry)) { char *filename =3D filepath + path_len - remain_len; diff --git a/fs/xfs/xfs_handle.c b/fs/xfs/xfs_handle.c index 0689cade8f74..7e3ddf2967c6 100644 --- a/fs/xfs/xfs_handle.c +++ b/fs/xfs/xfs_handle.c @@ -94,8 +94,7 @@ xfs_find_handle( =20 if (fd_empty(f)) return -EBADF; - path =3D fd_file(f)->f_path; - path_get(&path); + path_clone(&fd_file(f)->f_path, &path); } else { error =3D user_path_at(AT_FDCWD, hreq->path, 0, &path); if (error) diff --git a/kernel/trace/bpf_trace.c b/kernel/trace/bpf_trace.c index 29260951aa87..ebe957432213 100644 --- a/kernel/trace/bpf_trace.c +++ b/kernel/trace/bpf_trace.c @@ -3233,8 +3233,7 @@ static int bpf_uprobe_multi_get_path(const union bpf_= attr *attr, struct path *pa CLASS(fd, f)(path_fd); if (fd_empty(f)) return -EBADF; - *path =3D fd_file(f)->f_path; - path_get(path); + path_clone(&fd_file(f)->f_path, path); return 0; } =20 diff --git a/security/apparmor/task.c b/security/apparmor/task.c index e16ff4130bc2..36ca424760e2 100644 --- a/security/apparmor/task.c +++ b/security/apparmor/task.c @@ -337,8 +337,7 @@ static const char *get_current_exe_path(char *buffer, i= nt buffer_size) exe_file =3D get_task_exe_file(current); if (!exe_file) return ERR_PTR(-ENOENT); - p =3D exe_file->f_path; - path_get(&p); + path_clone(&exe_file->f_path, &p); =20 if (aa_path_name(&p, FLAG_VIEW_SUBNS, buffer, &path_str, NULL, NULL)) path_str =3D ERR_PTR(-ENOMEM); diff --git a/security/keys/big_key.c b/security/keys/big_key.c index 268f702df380..e20de015c626 100644 --- a/security/keys/big_key.c +++ b/security/keys/big_key.c @@ -121,8 +121,7 @@ int big_key_preparse(struct key_preparsed_payload *prep) * later */ payload->data =3D enckey; - payload->path =3D file->f_path; - path_get(&payload->path); + path_clone(&file->f_path, &payload->path); fput(file); kvfree_sensitive(buf, enclen); } else { diff --git a/security/landlock/fs.c b/security/landlock/fs.c index 330a1871bf94..3c614c56e3f8 100644 --- a/security/landlock/fs.c +++ b/security/landlock/fs.c @@ -892,8 +892,7 @@ is_access_to_paths_allowed(const struct landlock_domain= *const domain, child2_is_directory =3D d_is_dir(dentry_child2); } =20 - walker_path =3D *path; - path_get(&walker_path); + path_clone(&*path, &walker_path); /* * We need to walk through all the hierarchy to not miss any relevant * restriction. diff --git a/security/landlock/syscalls.c b/security/landlock/syscalls.c index 1d02d57f4c48..003f4aa12e4b 100644 --- a/security/landlock/syscalls.c +++ b/security/landlock/syscalls.c @@ -349,8 +349,7 @@ static int get_path_from_fd(const s32 fd, struct path *= const path) IS_PRIVATE(d_backing_inode(fd_file(f)->f_path.dentry))) return -EBADFD; =20 - *path =3D fd_file(f)->f_path; - path_get(path); + path_clone(&fd_file(f)->f_path, path); return 0; } =20 --=20 2.53.0 From nobody Fri Sep 25 11:05:14 2026 Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8AFBA26CE2C for ; Sun, 13 Sep 2026 14:50:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.48 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311007; cv=none; b=B+B67nQEYIWo7gSqPepfJWFXYdRIVZ8jumtugbbzt8u8IN7xw1ZagX2ECyuknzPM0FdUKzKxEz/OmxptPoXO1nt+lXHGNgvmnxfrVtEKwQB0qZsj6/dP6sdPtQ2AC8FN3OzLp42PHDRCJ6cOw+lt9nxBJHVrxh4kNEdbqLuH9Fk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311007; c=relaxed/simple; bh=K+PLmOasqiFz49SkYI5ZQC8ph7i9n+Ko+tC6kFac36M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=kyjpNXYS5hByBn6ak4Kt1xwGjWmmY/NbiYVFqGjofDQ/s9XYZNvTTqZNq4hU0ioR0HN1H4rlFhRgOFdS3C/fJHQsb50zMnjjjJUp8qW9W4xgrHHaHQMLLRHN0xH3zJ0eEj4poyJ6GA1NGuRgERJoY5/3yKCFy+/Bpg9RzpqH2ko= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Ue86N306; arc=none smtp.client-ip=209.85.128.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Ue86N306" Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-49d05d51553so20371995e9.2 for ; Sun, 13 Sep 2026 07:50:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789311001; x=1789915801; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=lYu04XwjPKA7ypsZV/R/wfXfVMywl2LPILiCNN7k2X0=; b=Ue86N306bpHMXOd9Thm4wxf8hgGgCAN9galG+qJ2pJ7CkAziCtvZgpiBf5RJH8Os6t a33BOJYTIfu++pQQQ7r5jEtFxZWd0PL2B2Wvro4mA80Q4SxZcFTlZEzn70GTnSH11QfF Hu1/ZWnEeit8wpAorqdBq0VHfzeAXm4xesBUVIsZEeUd69lW6uxUDI9sYC0HWcZL8UOE SSw0JxxuoAxpt5WQrWKGtVe1bS/31iJogWmnkOQyNw+MeS+GpIV3hRSf99+gOG3F0Hid YRIR/Fu7OFrCU53BruiNSLL7b+re3dJLgo8M+mYG5NmtZZzdo6x6a8jVlvq4+GNgHGur 9GWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789311001; x=1789915801; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=lYu04XwjPKA7ypsZV/R/wfXfVMywl2LPILiCNN7k2X0=; b=PuLJBmUlgm9EiEvnviFQPHE+Or6DasLtLAbexiGS9jgbNJLFyj4FvM1uIlBXm9U/+N Qu1KF3EbBbkQSo89Fus6I4wkodvbe7OXvF2s9+yl1LuEleMnrNwcFCrFEZsu3P4zeaou RQ7GpYHu2lADNIhTiNGi+dR2hfG469YmMfVeFSuuD0Pi033obPqZdxqkkGXgZKBEH9d/ tLWif/39q55Q1bNIJLzg27mD0qGQ9QTexdMSpg4pLqU6vO7qE7qZBmc+uejIC4Q+MT0k wBzzo1+bRIednQE7hyjEo3tybeeIuZgjfR7Oiff6U/sQG/NqJpgY+lnxVIo3xcvNUldk Sjfg== X-Forwarded-Encrypted: i=1; AKwUvBx/qN1tEWxO7sqTG2oH5WlavCE5S21caoYXdq7AEgIBnaT4saUwrtMTnvze3gBIsVKEtznHN5VLKHb6t6w=@vger.kernel.org X-Gm-Message-State: AFuF++k1+YK0sO/WzCwmeXopN3YiP1NYgCDZUcXm3C0B6vc5fsaJQvih Z7cZhH+xtmQz3/vbHnesb/EJxxfvIhdJeWuFoT4ZhKOnDxBaEzRVpH/G X-Gm-Gg: AYBFou1i78MAKV86R5qtOJApId4oQeEOv6FGyMhysFjU8BS5X8h+K6cHR8mm2zxGOhM kUCkDautRdg8LU/UH0SViDpouk8oSTXjRfC7x8j8Jyh/8KVH6hplq+/9hNUv8k99BqS5sJAxFMP iKNrP6G89nxG7N6WN+1ZsXv2l/puqYZCeOUuvwxtmZMI4O+w1V/vbGHN9oUuLY6txdETOxr9Hgr VXfc2697N8uw8towK+4stlZp3dkacnfqAqMmC2Smz+LzIjZzQULuabiXsbAhRnzxnXdpL9eBLQd LrEjgJyJzZot60THPQbgObjsXatT6g222GRfHrlYjXkcqzFgFkAgJWzF80BoJMSTqw4Z/hKlvjJ yfNwbAlKyb2l+FHxsWOgWsFhlcwlxdHcgfNgvmwo8T+iZNg7Q1zEMgZE5586UDp8i2P3TDjCH0G UcqGZthQ5eTDmEOvSYIswZsBNheto3rHtufWWabwg11IWXOBsD7ACe5H0S1GpJB3dpkDvwT2Bd3 Z3PqN9HmLlce1fDqNiVHzfrsPuFuXCBR9U+O9qQGGE= X-Received: by 2002:a05:600c:620b:b0:49e:6bce:b0f9 with SMTP id 5b1f17b1804b1-49e6bceb168mr77747365e9.16.1789311001488; Sun, 13 Sep 2026 07:50:01 -0700 (PDT) Received: from f.. (cst-prg-84-1.cust.vodafone.cz. [46.135.84.1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e6420de77sm109534235e9.3.2026.09.13.07.50.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 07:50:01 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Mateusz Guzik Subject: [PATCH 07/10] autofs: use path_create() Date: Sun, 13 Sep 2026 16:49:14 +0200 Message-ID: <20260913144918.1606123-8-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260913144918.1606123-1-mjguzik@gmail.com> References: <20260913144918.1606123-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" No functional changes. Signed-off-by: Mateusz Guzik Reviewed-by: Jan Kara --- fs/autofs/expire.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/autofs/expire.c b/fs/autofs/expire.c index 5c2d459e1e48..9d19c47dc3cc 100644 --- a/fs/autofs/expire.c +++ b/fs/autofs/expire.c @@ -30,12 +30,12 @@ static int autofs_mount_busy(struct vfsmount *mnt, struct dentry *dentry, unsigned int how) { struct dentry *top =3D dentry; - struct path path =3D {.mnt =3D mnt, .dentry =3D dentry}; + struct path path; int status =3D 1; =20 pr_debug("dentry %p %pd\n", dentry, dentry); =20 - path_get(&path); + path_create(&path, mnt, dentry); =20 if (!follow_down_one(&path)) goto done; --=20 2.53.0 From nobody Fri Sep 25 11:05:14 2026 Received: from mail-wm2-f13.google.com (mail-wm2-f13.google.com [74.125.225.141]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D4E382E7F39 for ; Sun, 13 Sep 2026 14:50:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.141 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311009; cv=none; b=AUI6dccFVm0+sjVVSEjmRykG4thtZ6FBPc+I0+8TQgwuRXEKX1yn4wXVPtzzsBYQk25YxVrym6H7/RbM8TS5AWKmtX4snsCmjk5QlTx0YpcTZ7X8ZoWXOuEURuGv1CEvzray8f00O8aTnPW9LtSHA0o7GkoHIItDpEsFtTDTfPo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311009; c=relaxed/simple; bh=Clj/Ouwd0dLN04eWZNySPzYuAllNrDtuMX3q2A156eE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=AMQNM3lvWMBjKcpjH4oa0DCm3V3waB/aUqykajdNbmAv1y+IteHUlEgw2ZJKfw3x3JhOy54BPPfvAbI5SSJSZ8oS1A+rZIBtMk7CW7WPcdAMBNqCaH1uwdbY8ZS9sYUfWJYQJcFwImFnp0CEIOsU0Rv2cjYcaeng6/sVPS10CY8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=qCdfVcVT; arc=none smtp.client-ip=74.125.225.141 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="qCdfVcVT" Received: by mail-wm2-f13.google.com with SMTP id 5b1f17b1804b1-49b965f447cso7987575e9.3 for ; Sun, 13 Sep 2026 07:50:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789311003; x=1789915803; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=81asV8b/fnkXYfig/nnujoqba+Y5BqtppTUW9bEFFN4=; b=qCdfVcVTppuEsLa+D676p/InGo3GNUkXfxB5IiFS/bsc4OiyX3YrE7yNOu0oBaHHjg MpoT7aJXUMv/SCbTnFV0mloEu61Mmxh7VRC4TwA7x8X4B/vAyHsFcvQ+CVEtD1jdYTlJ dtaVZyyg7gkOZ7eGCkeANG4FZwAj410y3LDCHUrHYMcs491oc5P4qvW8OKXJGufH5zh9 TWJx71rPCw3/7rhbDIIeQdUOLPIkQj6wZDdmfht9+5/CfWpXcZFrmbXwvvUC8/WgoMJe X0XMyGcpFEYHzl3szcIGZM06rc33z6G1kz8nPbcqLEResblNzIQHaYYCz3bB/zLO+11B UqsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789311003; x=1789915803; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=81asV8b/fnkXYfig/nnujoqba+Y5BqtppTUW9bEFFN4=; b=hsCITJq/HOndAXfcY8HIf4ZCwfl+4zAGfsou5MmrL9o23h05VwdSDT9srYHI/yFBv7 LM12dLDSh0Vv/oGu/vzPIwHvwadSrxOueyNwP7oK39IjprN11VHxa5QXTQ4KOOjvM1+N M1j13NmyD0yO3fltRb7W91gWIgPFdjJZKSx5LBo7ovwvP3HoQHjHd2jxKJnh+jLs/MbF yU0C9TPeqbiky760Z4Jtcc0z5JlikukO4Hgq6UnqX8H6/D683KzZh8vjAnZMRvZGAn31 LaAAegAWtXyUaEoP0j/3z4xiZ8oXkQs5ZE6GhL3cEKMmZdTM8JZJecHFkwYEF7/h2c5H NRCQ== X-Forwarded-Encrypted: i=1; AKwUvBxRE6kosrCJrYNTenozVMSsjl1922Un2nxquktlP4S9IRyhRDgKXGFKv/aTjcpheJp2Ok2qe1qvthndmKA=@vger.kernel.org X-Gm-Message-State: AFuF++nJMGMAd9tHC+TdaDYCjd4pv8hT0wSQALnoOHXacrwLWy/m32Xn FdFQ9ox/+8ckLl2vBN8PzhCKK5mWKWI6olJuzPqLHRqLbgtKXmcB6Vt3 X-Gm-Gg: AYBFou1i5iNo3SFPRnUS1p+n0PPWLqIjvMvt5bkguyvMGpUttFwHbgC5het+P1XuQs4 hZ/ybQJCZgDZtnPSQkSSnvRovgPCsyq1sow+NCCAnuYg1ra3T//p80tYQHsSHNexhlwwZ35XJBh rDbI9pV4QHTIVE9MBjAwJwycoE0Ofjbcp3BzKW4j3eFZG5zAGvGLBTPQPNEWkcNIYq5R1ChulVa A/KeqYDEbA4qQovBmBLdg2M+Wxo/6N6ovGqJdEhsWa45rgNsCHscxZdIFMd8O9XGbd0nbI0VGKk LQ1xUdd1MgkOG8p1oDvZ1bKoSLLT5LJ9K+iCt1XkFlVkz7w23bBJSCZHbR3PlNnleqwpmoSD52L XNkC1PEmaGpEB+PT909V8wBQQMDzvaISPWINW+PelhD5HXSCS+vqu4ue7WerhokbhB3j0gnsEi+ cExnAvRRfc2yQ9g4qauBYsHp7DbPBkH/jTlsK38W49EXTroiRUFYsHoubVC7MbrHl+kroU+fvoR Wv3449eG0jnBhSV9/lFdCFKdWoDBYGf3Q4hRkCqdpM= X-Received: by 2002:a05:600c:5489:b0:49d:16dc:e721 with SMTP id 5b1f17b1804b1-49e6cc0ab17mr57452735e9.24.1789311003081; Sun, 13 Sep 2026 07:50:03 -0700 (PDT) Received: from f.. (cst-prg-84-1.cust.vodafone.cz. [46.135.84.1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e6420de77sm109534235e9.3.2026.09.13.07.50.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 07:50:02 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Mateusz Guzik Subject: [PATCH 08/10] fsnotify: use path_clone() Date: Sun, 13 Sep 2026 16:49:15 +0200 Message-ID: <20260913144918.1606123-9-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260913144918.1606123-1-mjguzik@gmail.com> References: <20260913144918.1606123-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" No functional changes. Signed-off-by: Mateusz Guzik Reviewed-by: Jan Kara --- fs/notify/fanotify/fanotify.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c index a208a7ec1692..84b4c505dbe3 100644 --- a/fs/notify/fanotify/fanotify.c +++ b/fs/notify/fanotify/fanotify.c @@ -559,9 +559,8 @@ static struct fanotify_event *fanotify_alloc_path_event= (const struct path *path, return NULL; =20 pevent->fae.type =3D FANOTIFY_EVENT_TYPE_PATH; - pevent->path =3D *path; *hash ^=3D fanotify_hash_path(path); - path_get(path); + path_clone(path, &pevent->path); =20 return &pevent->fae; } @@ -600,10 +599,9 @@ static struct fanotify_event *fanotify_alloc_perm_even= t(const void *data, pevent->hdr.len =3D 0; pevent->state =3D FAN_EVENT_INIT; pevent->watchdog_cnt =3D 0; - pevent->path =3D *path; pevent->pos =3D range ? range->pos : FANOTIFY_NO_RANGE; pevent->count =3D range ? range->count : 0; - path_get(path); + path_clone(path, &pevent->path); =20 return &pevent->fae; } --=20 2.53.0 From nobody Fri Sep 25 11:05:14 2026 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39476302767 for ; Sun, 13 Sep 2026 14:50:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.50 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311009; cv=none; b=GUSTKPeRuABGMSAgc6kPKqNYHJRNlrwoJzwDCWTuErdeL2VX5MhmIYRRDGXa4XC7rb7xvStNtPTHtolOXx9mtIHCoZqNsZW7ErmwmsgFjcgU750AituPfN/b8x16ZmF/I76kvYnzQC4Yovsdk22fPXwRqF6/kPzbMMKbQEAz2Mo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311009; c=relaxed/simple; bh=hcHBjfQv2vt4O6bNCDsSTnuv3uAc9pY+xex1NeHkj3I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Yu9J0xem69F8uaoDQWqLX9PyxcpY9/YEseYC4KStDKID4CR7PA9IV5dRFLdZhSOdOY9eDtIa1rf33vfreVnlArNi1FKeuPCQW4TNfJ+rTJnUdKiJ3u64ojsaOnSjGE5g6MNm2twJusKHuQci2ei/hYguwxhlHgV+RMxlUvjzPNU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=k8/P96AF; arc=none smtp.client-ip=209.85.128.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="k8/P96AF" Received: by mail-wm1-f50.google.com with SMTP id 5b1f17b1804b1-4998b5a63e2so26838015e9.1 for ; Sun, 13 Sep 2026 07:50:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789311004; x=1789915804; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=W133JhUAHBaW2yCEgAwNUk4+ZgihaBOC1mOOkFbU1Iw=; b=k8/P96AFDiK1s9ycYJwuGroDreTey0n+6MQeDu58gbYAEj5y0MfzqYwb36XT18fk9D vRf33uUnika5lEDOKjZ+EeeLK47SixwLN1VbvqhIJe2wz8hxr3kBzM0QbmBNEP+Zb+d0 jptZCqI8cJYjRSoeVa8foqjZcX8+H/OVr4XBlvmVmRju2U9abGt+gKpM/1LfyP+uyiJI t1kesrDZpHKWHThS2ZlttvYvmCuhsXlxAPYJQdzsas8PkAvaus0yF5O0wn6c+i0zsf5t yWH8nfFNEfQUaYZpJJJirySv/non9laJn6uoxoaf6wjta3kTrtt5zcRNwnZdeXK8NC1W XGzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789311004; x=1789915804; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=W133JhUAHBaW2yCEgAwNUk4+ZgihaBOC1mOOkFbU1Iw=; b=nJ9ruWQRGph/kzJoO+9a4YtE+lwqS2C1auxqeNq/RyZs1N4yzbZrdgXv7/k02s5X4H xHvdxf9guZrTeyNfmOkP5m7nNHwXpXr9In8e0gw1MiWuBsKxB/lZv2PVEMjQxXh4OBK5 kQJm+Y3MkeEKye367FeH0K4u+SLLrLAvyhIOPPi4r8SMA7hKyYCblMvJ/2LQ/0Xk2kJf +qbqxvBKPelfhHHlDkr3POIdg7u9wdWeesImEUZLZ4h06Qv90KjmcveDa2pHuzreGi+h xXjqIzkMeNjj2rAE1Q7x5Pmzf69KQPcWyIkRHbLT089OonlWCR2hBzGYXRHaeZPXNUR4 kNMA== X-Forwarded-Encrypted: i=1; AKwUvBxKVgsQ7OCjKfxiTdveu10Y+e0FMcnRwoQH17AKB4LtA54Vu+/I3gWMu8uGtLiXEJKUxrPgDBilM+QTo5Q=@vger.kernel.org X-Gm-Message-State: AFuF++lgvg69CcAJg25/XtItZjDDK1XqZcrUzZXkPOeTh03ypzT22teg 0hzas/afUrDlWScm+zZqSjpokTb6pBkE3tgQl3h9Ub6NbH2RgN312lYH X-Gm-Gg: AYBFou3uCe02npdKilgatHweJmAwcXc08k1URGrR+YEC6M7Vy8Nbd+pUFUNWsACLJlI 6ruYCOcdUTPxgTmt9g50mkQ4t0gkDv5RzqXXMp0jBx9MxjdxT/RnQ1nRyrDFBGwvnEF0RkcbvWk SkLRHKhRJo/LTRQ4oOjqtScwTeb7gh4tsBx5aEwBV7RADkAhL8FVMO1zqg4nh2lXskZOOFA4IwE se2A0VhW4KwKEtt/uSb9OxIToJ5f118fTy1/g8VJ43o/eaiDQxmvetztymtgDcjzT4k9F8lp2g4 QB6PSEECA7++kIjgxqyZQbDH31v3exbLf0HIFUXP9XUZztHL3IYtOmurdcF3UbTtw2sYIbEqg3i oJH+wkhktuyqnT6o5au6xYvuSHuq7j3JvqlEq0YOvI6VU3cXlp//V2DEPUb0sRr5hDTBg28GoVb xCyGJi59gP7oRjgXbUbyzGsEb7sD3kJ+BgNAT4AE43QQfEd/coCrkhKkdC6XQJa4Z+GnyHEY/zC 5EYTPycAKSzSgHJXXhtW40emNj92nltudDw36ELOOQ= X-Received: by 2002:a05:600d:6501:20b0:495:48d7:f178 with SMTP id 5b1f17b1804b1-49e61988e73mr99621045e9.11.1789311004217; Sun, 13 Sep 2026 07:50:04 -0700 (PDT) Received: from f.. (cst-prg-84-1.cust.vodafone.cz. [46.135.84.1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e6420de77sm109534235e9.3.2026.09.13.07.50.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 07:50:03 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Mateusz Guzik Subject: [PATCH 09/10] proc: use path_clone() Date: Sun, 13 Sep 2026 16:49:16 +0200 Message-ID: <20260913144918.1606123-10-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260913144918.1606123-1-mjguzik@gmail.com> References: <20260913144918.1606123-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" No functional changes. Signed-off-by: Mateusz Guzik Reviewed-by: Jan Kara --- fs/proc/base.c | 3 +-- fs/proc/fd.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/fs/proc/base.c b/fs/proc/base.c index 01d8bfe1c410..6b055352eabd 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1766,8 +1766,7 @@ static int proc_exe_link(struct dentry *dentry, struc= t path *exe_path, =20 exe_file =3D get_task_exe_file(task); if (exe_file) { - *exe_path =3D exe_file->f_path; - path_get(&exe_file->f_path); + path_clone(&exe_file->f_path, exe_path); fput(exe_file); return 0; } else diff --git a/fs/proc/fd.c b/fs/proc/fd.c index 0f9a1556f2a3..9ab9bfd6e48d 100644 --- a/fs/proc/fd.c +++ b/fs/proc/fd.c @@ -180,8 +180,7 @@ static int proc_fd_link(struct dentry *dentry, struct p= ath *path, =20 fd_file =3D fget_task(task, fd); if (fd_file) { - *path =3D fd_file->f_path; - path_get(&fd_file->f_path); + path_clone(&fd_file->f_path, path); ret =3D 0; fput(fd_file); } --=20 2.53.0 From nobody Fri Sep 25 11:05:14 2026 Received: from mail-wm2-f12.google.com (mail-wm2-f12.google.com [74.125.225.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9B1593064B5 for ; Sun, 13 Sep 2026 14:50:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.225.140 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311009; cv=none; b=N+7jEM3ti/RFbYrIZUkyDC89+n/+jh0Itqx0glq7bXv/IDMKu9CYEUyV6YLs7jE6yiwf8bx/b4NFXwAUtgMZ97jNxTsTLIY7+kl7O+zG8UBd20e0o9yOLCdth6d8F4ienasx+QJtrveKJmAUZJDCVMCWO0ao/w3sBzTJpSYZkyo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789311009; c=relaxed/simple; bh=P9Op4lsJc/HwOr9jdCJ522h1eE0TJiozb+9WvD8ELRM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fXx/ojrwGljUVlEH6dYYJVqIejdwP+KjP5q239noEo2azwnZCEyY9lGQ1Df3p8TYRtrhqW6VQKGif5YETDwgEIwGn9PCubenXtMIs7SvfzWFqR76fpaU66UnVjp1jdJwpQeBJywVG5Bf6vVqFe49pplNF0VCXyuFdWjv7EdbjnU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=khCppjpA; arc=none smtp.client-ip=74.125.225.140 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="khCppjpA" Received: by mail-wm2-f12.google.com with SMTP id 5b1f17b1804b1-49ccf3ca626so4065265e9.0 for ; Sun, 13 Sep 2026 07:50:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789311006; x=1789915806; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=45V3oYN24WWaNfR3SZkM292e3snBgoENKm4rPxJfUnk=; b=khCppjpAcYgGDeEjzqEkgRhOiUO9qjGU4FIzciMSeyNqMmIzlskEdQjEtSD4Z6en4V Ip2427+xIinUkxDVBbTnD0lhoNvAN/I24nUBYGOLzuTHb5bvchN9rwLlka0DQUFsy3hR EPq0fTUpMDZssbXXyFP1yIQj3iHMg9+F3EJPuV2gIZVLmHEpUPYaIdamlQhcqFtQv4/t RzOKYYPu7HY6EmmYPQz4UXSBqB5jvdt3AzA/Mwb933FZSZ8bQ2dh/LlevqpHkpNDIMLE laUsY+UigUL7wtNZFdLc+FnVPD0LHZ4y8U2BdxlHyqKRczE+8oR8fE8WAONLcLWEE4Tt Mmaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789311006; x=1789915806; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to:content-type; bh=45V3oYN24WWaNfR3SZkM292e3snBgoENKm4rPxJfUnk=; b=lM8JhGo9Kz2rs6VTC1tSdQQGs77SlaR8XLvFryIWOQXqM5tf52veCJaFjpbRLnvxDn yLKsfgOWnybGFtKuI4e8idiYgmedyFYgkerunFkrJ32Dxb4RWi119+YVjQSU4OjvOoAn yKpg/lpvXA6E5Ytl7rfAszzfcnds5QRyG7+rqk8AXLgy40oMh88SxXI2mvTvVlR5iVri 2/0w5b38PUrnRbryd+3yjLA3QTN2VnwimsvJuuVfGOegOjn1/Gw0/+Qb2IR2EjzgzEyw EVasxE8eplZr2SDu9etwrdOqIwEaOs7b2xOMjwRakQKARveBKfKJmq3mK0IkH2eQ/p3C pL8A== X-Forwarded-Encrypted: i=1; AKwUvBwFcZtClVgD4p9Qi+87jWHGeMHrWaB9In13yTRzvjW5puwOyj9FxNeKXU9cqHEPyAg+USKrAqK5Nhn7WHw=@vger.kernel.org X-Gm-Message-State: AFuF++mV6KKbVjCuI8gSB2tPeyDg64e0XSfcWQv35A7yIROFVrUWHFP9 1YzRKTaRLSbebR6Ywf3hrEWeVgHM1azp9t/ziirm22lkfuEIlOx4QsT2 X-Gm-Gg: AYBFou3x5RvELwvKpS29oeMay2Tlcz1gil2smTwJopZPao1ptICozmAGP6mM6lehSnX 4DqIkmVfUmpcex9wXK+ocqgJ5d7l1WN4E2qsDFZzYXn8DOcC4BtZiEiXGErRPgKoWIige63UOSx xajxr8PLF4YIdUY8PgNWTXBTDenF5stUHqp1XUGAHhzZuzZGANi83gXcr2/cj2em+Bc3Xzy9h8Z YcCwRtngvoG+wrBxWbPSImFwWCIioxZds5Dcbzo2iae8YXpTwa1A0Wm/i0YyLIlYwe0BDv78b7s +u0QntUgGrq5OvZFeErVUIbymXi/1ln55JERDsFvQ7AsxFn/y5OUgnRyk/caLNPI6q00OkmLmp7 xuS/bOBGKQxG4CCoDUQamN5tp0WXZQdAkFVR74kgQ1pEsQaTJ9p7nzlHTW7ZSfKfyFN6VfhHzKr TaqVNa8ohdmov/lcVY97uu1g27o++PzlYwdHgpWHWNxycPFGmSuz2m0U35M7KEdtBKQz7rC9gr+ vCrNWkrTGgQCKb+INsCmngFauJFHFfYBvgp/TL+a3Y= X-Received: by 2002:a05:600c:34c2:b0:49c:fea1:f792 with SMTP id 5b1f17b1804b1-49e6cacf765mr67544475e9.12.1789311005425; Sun, 13 Sep 2026 07:50:05 -0700 (PDT) Received: from f.. (cst-prg-84-1.cust.vodafone.cz. [46.135.84.1]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49e6420de77sm109534235e9.3.2026.09.13.07.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 13 Sep 2026 07:50:04 -0700 (PDT) From: Mateusz Guzik To: brauner@kernel.org Cc: viro@zeniv.linux.org.uk, jack@suse.cz, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Mateusz Guzik Subject: [PATCH 10/10] nfsd: use path_clone() Date: Sun, 13 Sep 2026 16:49:17 +0200 Message-ID: <20260913144918.1606123-11-mjguzik@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260913144918.1606123-1-mjguzik@gmail.com> References: <20260913144918.1606123-1-mjguzik@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" No functional changes. Signed-off-by: Mateusz Guzik Reviewed-by: Jan Kara --- fs/nfsd/export.c | 6 ++---- fs/nfsd/nfs4xdr.c | 8 ++++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c index e5a0f1ababe6..84ea833816b5 100644 --- a/fs/nfsd/export.c +++ b/fs/nfsd/export.c @@ -233,8 +233,7 @@ static inline void expkey_update(struct cache_head *cne= w, struct svc_expkey *new =3D container_of(cnew, struct svc_expkey, h); struct svc_expkey *item =3D container_of(citem, struct svc_expkey, h); =20 - new->ek_path =3D item->ek_path; - path_get(&item->ek_path); + path_clone(&item->ek_path, &new->ek_path); } =20 static struct cache_head *expkey_alloc(void) @@ -1533,8 +1532,7 @@ static void svc_export_init(struct cache_head *cnew, = struct cache_head *citem) =20 kref_get(&item->ex_client->ref); new->ex_client =3D item->ex_client; - new->ex_path =3D item->ex_path; - path_get(&item->ex_path); + path_clone(&item->ex_path, &new->ex_path); new->ex_fslocs.locations =3D NULL; new->ex_fslocs.locations_count =3D 0; new->ex_fslocs.migrated =3D 0; diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index 7d1b2d6f57f2..65a805501b75 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c @@ -2966,14 +2966,14 @@ static __be32 nfsd4_encode_pathname4(struct xdr_str= eam *xdr, const struct path *root, const struct path *path) { - struct path cur =3D *path; + struct path cur; struct dentry **components =3D NULL; unsigned int ncomponents =3D 0; __be32 err =3D nfserr_jukebox; =20 dprintk("nfsd4_encode_components("); =20 - path_get(&cur); + path_clone(path, &cur); /* First walk the path up to the nfsd root, and store the * dentries/path components in an array. */ @@ -3216,11 +3216,11 @@ static __be32 fattr_handle_absent_fs(u32 *bmval0, u= 32 *bmval1, u32 *bmval2, u32 =20 static int nfsd4_get_mounted_on_ino(struct svc_export *exp, u64 *pino) { - struct path path =3D exp->ex_path; + struct path path; struct kstat stat; int err; =20 - path_get(&path); + path_clone(&exp->ex_path, &path); while (follow_up(&path)) { if (path.dentry !=3D path.mnt->mnt_root) break; --=20 2.53.0