[packages/kernel] Rel 2. Update aufs to 7.3-20261116, fix i686 config

arekm arekm at pld-linux.org
Tue Nov 24 09:19:39 CET 2026


commit 066a59c43948fb8561a4772fb33640d70ae23253
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date:   Tue Nov 24 09:18:45 2026 +0100

    Rel 2. Update aufs to 7.3-20261116, fix i686 config
    
    Enable the new RTC_HCTOSYS_TIME32_LIMIT.

 kernel-aufs-dirren-overflow.patch |   40 +
 kernel-aufs-exports.patch         |   18 -
 kernel-aufs.patch                 | 1822 +++++++++++++++++++++++--------------
 kernel-multiarch.config           |    3 +-
 kernel.spec                       |    6 +-
 update-source.sh                  |    4 +-
 6 files changed, 1187 insertions(+), 706 deletions(-)
---
diff --git a/kernel.spec b/kernel.spec
index 91d38cac..750a4204 100644
--- a/kernel.spec
+++ b/kernel.spec
@@ -51,7 +51,7 @@
 %define		have_drm	0
 %endif
 
-%define		rel		1
+%define		rel		2
 %define		basever		7.3
 %define		postver		.6
 
@@ -151,8 +151,8 @@ Patch59:	kernel-rndis_host-wm5.patch
 
 # see update-source.sh
 Patch145:	kernel-aufs.patch
-Patch146:	kernel-aufs-exports.patch
 Patch147:	kernel-aufs-make.patch
+Patch148:	kernel-aufs-dirren-overflow.patch
 
 # Show normal colors in menuconfig with ncurses ABI 6
 Patch250:	kernel-fix_256colors_menuconfig.patch
@@ -559,8 +559,8 @@ cd linux-%{basever}
 %if %{with aufs}
 # aufs
 %patch -P145 -p1
-%patch -P146 -p1
 %patch -P147 -p1
+%patch -P148 -p1
 %endif
 
 %if %{with rescuecd}
diff --git a/kernel-aufs-dirren-overflow.patch b/kernel-aufs-dirren-overflow.patch
new file mode 100644
index 00000000..73e5dac1
--- /dev/null
+++ b/kernel-aufs-dirren-overflow.patch
@@ -0,0 +1,40 @@
+aufs: dirren: keep the drinfo buffer size in an unsigned int
+
+au_drinfo_store.allocated is unsigned char, so a buffer grown to 256
+bytes or more stores 0; the next au_drinfo_construct() then sizes the
+buffer by the name length alone and memcpy() writes sizeof(*f) bytes
+past it (e.g. 65-char name on one lower branch, 255-char on the next).
+Size the buffer from the full requirement and keep it in an unsigned int.
+
+diff --git a/fs/aufs/dirren.c b/fs/aufs/dirren.c
+index 6cc9e568c..36b040c4c 100644
+--- a/fs/aufs/dirren.c
++++ b/fs/aufs/dirren.c
+@@ -471,7 +471,7 @@ static int au_drinfo_name(struct au_branch *br, char *name, int len)
+  */
+ static int au_drinfo_construct(struct au_drinfo_fdata **fdata,
+ 			       struct dentry *h_dentry,
+-			       unsigned char *allocated)
++			       unsigned int *allocated)
+ {
+ 	int err, v;
+ 	struct au_drinfo_fdata *f, *p;
+@@ -487,7 +487,7 @@ static int au_drinfo_construct(struct au_drinfo_fdata **fdata,
+ 	drinfo->ino = (__force uint64_t)cpu_to_be64(h_inode->i_ino);
+ 	drinfo->oldnamelen = qname->len;
+ 	if (*allocated < sizeof(*f) + qname->len) {
+-		v = roundup_pow_of_two(*allocated + qname->len);
++		v = roundup_pow_of_two(sizeof(*f) + qname->len);
+ 		p = au_krealloc(f, v, GFP_NOFS, /*may_shrink*/0);
+ 		if (unlikely(!p)) {
+ 			err = -ENOMEM;
+@@ -598,8 +598,8 @@ struct au_drinfo_store {
+ 	char *infoname;			/* inside of whname, just after PFX */
+ 	char whname[sizeof(AUFS_WH_DR_INFO_PFX) + AUFS_DIRREN_ENV_VAL_SZ];
+ 	aufs_bindex_t btgt, btail;
++	unsigned int allocated;		/* current size of *fdata */
+ 	unsigned char no_sio,
+-		allocated,		/* current size of *fdata */
+ 		infonamelen,		/* room size for p */
+ 		whnamelen,		/* length of the generated name */
+ 		renameback;		/* renamed back */
diff --git a/kernel-aufs-exports.patch b/kernel-aufs-exports.patch
deleted file mode 100644
index c5bd3838..00000000
--- a/kernel-aufs-exports.patch
+++ /dev/null
@@ -1,18 +0,0 @@
---- linux-7.0/fs/namespace.c~	2026-04-24 21:35:57.000000000 +0200
-+++ linux-7.0/fs/namespace.c	2026-04-25 11:43:27.786675705 +0200
-@@ -2278,6 +2278,7 @@
- 		path_get(p);
- 	return res;
- }
-+EXPORT_SYMBOL_GPL(collect_paths);
- 
- void drop_collected_paths(const struct path *paths, const struct path *prealloc)
- {
-@@ -2286,6 +2287,7 @@
- 	if (paths != prealloc)
- 		kfree(paths);
- }
-+EXPORT_SYMBOL_GPL(drop_collected_paths);
- 
- static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *, bool);
- 
diff --git a/kernel-aufs.patch b/kernel-aufs.patch
index 3e748836..d0591bf7 100644
--- a/kernel-aufs.patch
+++ b/kernel-aufs.patch
@@ -94,7 +94,7 @@ diff -urN /usr/share/empty/Documentation/ABI/testing/sysfs-aufs linux/Documentat
 +		will be empty. About XINO files, see the aufs manual.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/01intro.txt linux/Documentation/filesystems/aufs/design/01intro.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/01intro.txt	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/01intro.txt	2026-10-19 08:28:44.906666486 +0200
++++ linux/Documentation/filesystems/aufs/design/01intro.txt	2026-11-24 08:11:35.561076408 +0100
 @@ -0,0 +1,158 @@
 +
 +# Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -256,7 +256,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/01intro.txt lin
 +about it. But currently I have implemented it in kernel space.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/02struct.txt linux/Documentation/filesystems/aufs/design/02struct.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/02struct.txt	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/02struct.txt	2026-10-19 08:28:44.906666486 +0200
++++ linux/Documentation/filesystems/aufs/design/02struct.txt	2026-11-24 08:11:35.561255438 +0100
 @@ -0,0 +1,245 @@
 +
 +# Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -505,7 +505,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/02struct.txt li
 +For this purpose, use "aumvdown" command in aufs-util.git.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/03atomic_open.txt linux/Documentation/filesystems/aufs/design/03atomic_open.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/03atomic_open.txt	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/03atomic_open.txt	2026-10-19 08:28:44.906666486 +0200
++++ linux/Documentation/filesystems/aufs/design/03atomic_open.txt	2026-11-24 08:11:35.561255438 +0100
 @@ -0,0 +1,72 @@
 +
 +# Copyright (C) 2015-2026 Junjiro R. Okajima
@@ -581,7 +581,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/03atomic_open.t
 +       be implemented in aufs, but not all I am afraid.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/03lookup.txt linux/Documentation/filesystems/aufs/design/03lookup.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/03lookup.txt	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/03lookup.txt	2026-10-19 08:28:44.906666486 +0200
++++ linux/Documentation/filesystems/aufs/design/03lookup.txt	2026-11-24 08:11:35.561496523 +0100
 @@ -0,0 +1,100 @@
 +
 +# Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -685,7 +685,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/03lookup.txt li
 +   by over-mounting something (or another method).
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/04branch.txt linux/Documentation/filesystems/aufs/design/04branch.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/04branch.txt	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/04branch.txt	2026-10-19 08:28:44.906666486 +0200
++++ linux/Documentation/filesystems/aufs/design/04branch.txt	2026-11-24 08:11:35.561610306 +0100
 @@ -0,0 +1,61 @@
 +
 +# Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -750,7 +750,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/04branch.txt li
 +    same named entry on the upper branch.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/05wbr_policy.txt linux/Documentation/filesystems/aufs/design/05wbr_policy.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/05wbr_policy.txt	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/05wbr_policy.txt	2026-10-19 08:28:44.906666486 +0200
++++ linux/Documentation/filesystems/aufs/design/05wbr_policy.txt	2026-11-24 08:11:35.561721076 +0100
 @@ -0,0 +1,51 @@
 +
 +# Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -805,7 +805,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/05wbr_policy.tx
 +  copyup policy.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06dirren.dot linux/Documentation/filesystems/aufs/design/06dirren.dot
 --- /usr/share/empty/Documentation/filesystems/aufs/design/06dirren.dot	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/06dirren.dot	2026-10-19 08:28:44.906666486 +0200
++++ linux/Documentation/filesystems/aufs/design/06dirren.dot	2026-11-24 08:11:35.561808519 +0100
 @@ -0,0 +1,31 @@
 +
 +// to view this graph, run dot(1) command in GRAPHVIZ.
@@ -840,7 +840,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06dirren.dot li
 +}
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06dirren.txt linux/Documentation/filesystems/aufs/design/06dirren.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/06dirren.txt	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/06dirren.txt	2026-10-19 08:28:44.906666486 +0200
++++ linux/Documentation/filesystems/aufs/design/06dirren.txt	2026-11-24 08:11:35.561934099 +0100
 @@ -0,0 +1,89 @@
 +
 +# Copyright (C) 2017-2026 Junjiro R. Okajima
@@ -933,7 +933,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06dirren.txt li
 +equivalen to udba=reval case.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06fhsm.txt linux/Documentation/filesystems/aufs/design/06fhsm.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/06fhsm.txt	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/06fhsm.txt	2026-10-19 08:28:44.906666486 +0200
++++ linux/Documentation/filesystems/aufs/design/06fhsm.txt	2026-11-24 08:11:35.562056404 +0100
 @@ -0,0 +1,105 @@
 +
 +# Copyright (C) 2011-2026 Junjiro R. Okajima
@@ -1042,7 +1042,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06fhsm.txt linu
 +should restore the original file state after an error happens.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06mmap.txt linux/Documentation/filesystems/aufs/design/06mmap.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/06mmap.txt	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/06mmap.txt	2026-10-19 08:28:44.906666486 +0200
++++ linux/Documentation/filesystems/aufs/design/06mmap.txt	2026-11-24 08:11:35.562150070 +0100
 @@ -0,0 +1,27 @@
 +
 +# Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -1073,7 +1073,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06mmap.txt linu
 +will be much smaller than the approach aufs used to take.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06xattr.txt linux/Documentation/filesystems/aufs/design/06xattr.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/06xattr.txt	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/06xattr.txt	2026-10-19 08:28:44.906666486 +0200
++++ linux/Documentation/filesystems/aufs/design/06xattr.txt	2026-11-24 08:11:35.562267555 +0100
 @@ -0,0 +1,81 @@
 +
 +# Copyright (C) 2014-2026 Junjiro R. Okajima
@@ -1158,7 +1158,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/06xattr.txt lin
 +now, aufs implements the branch attributes to ignore the error.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/07export.txt linux/Documentation/filesystems/aufs/design/07export.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/07export.txt	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/07export.txt	2026-10-19 08:28:44.906666486 +0200
++++ linux/Documentation/filesystems/aufs/design/07export.txt	2026-11-24 08:11:35.562267555 +0100
 @@ -0,0 +1,45 @@
 +
 +# Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -1207,7 +1207,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/07export.txt li
 +  lookup_one_len(), vfs_getattr(), encode_fh() and others.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/08shwh.txt linux/Documentation/filesystems/aufs/design/08shwh.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/08shwh.txt	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/08shwh.txt	2026-10-19 08:28:44.906666486 +0200
++++ linux/Documentation/filesystems/aufs/design/08shwh.txt	2026-11-24 08:11:35.562267555 +0100
 @@ -0,0 +1,39 @@
 +
 +# Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -1250,7 +1250,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/08shwh.txt linu
 +initramfs will use it to replace the old one at the next boot.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/10dynop.txt linux/Documentation/filesystems/aufs/design/10dynop.txt
 --- /usr/share/empty/Documentation/filesystems/aufs/design/10dynop.txt	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/design/10dynop.txt	2026-10-19 08:28:44.909999820 +0200
++++ linux/Documentation/filesystems/aufs/design/10dynop.txt	2026-11-24 08:11:35.562267555 +0100
 @@ -0,0 +1,34 @@
 +
 +# Copyright (C) 2010-2026 Junjiro R. Okajima
@@ -1288,7 +1288,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/design/10dynop.txt lin
 +regular files only.
 diff -urN /usr/share/empty/Documentation/filesystems/aufs/README linux/Documentation/filesystems/aufs/README
 --- /usr/share/empty/Documentation/filesystems/aufs/README	1970-01-01 01:00:00.000000000 +0100
-+++ linux/Documentation/filesystems/aufs/README	2026-10-19 08:28:44.906666486 +0200
++++ linux/Documentation/filesystems/aufs/README	2026-11-24 08:11:35.556666666 +0100
 @@ -0,0 +1,398 @@
 +
 +Aufs7 -- advanced multi layered unification filesystem version 7.x
@@ -1690,7 +1690,7 @@ diff -urN /usr/share/empty/Documentation/filesystems/aufs/README linux/Documenta
 +# End: ;
 diff -urN /usr/share/empty/fs/aufs/aufs.h linux/fs/aufs/aufs.h
 --- /usr/share/empty/fs/aufs/aufs.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/aufs.h	2026-10-19 08:28:44.909999820 +0200
++++ linux/fs/aufs/aufs.h	2026-11-24 08:11:35.565987425 +0100
 @@ -0,0 +1,49 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -1743,7 +1743,7 @@ diff -urN /usr/share/empty/fs/aufs/aufs.h linux/fs/aufs/aufs.h
 +#endif /* __AUFS_H__ */
 diff -urN /usr/share/empty/fs/aufs/branch.c linux/fs/aufs/branch.c
 --- /usr/share/empty/fs/aufs/branch.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/branch.c	2026-10-19 08:28:44.909999820 +0200
++++ linux/fs/aufs/branch.c	2026-11-24 08:11:35.566289808 +0100
 @@ -0,0 +1,1412 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -3159,7 +3159,7 @@ diff -urN /usr/share/empty/fs/aufs/branch.c linux/fs/aufs/branch.c
 +}
 diff -urN /usr/share/empty/fs/aufs/branch.h linux/fs/aufs/branch.h
 --- /usr/share/empty/fs/aufs/branch.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/branch.h	2026-10-19 08:28:44.909999820 +0200
++++ linux/fs/aufs/branch.h	2026-11-24 08:11:35.566474760 +0100
 @@ -0,0 +1,362 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -3569,8 +3569,8 @@ diff -urN /usr/share/empty/fs/aufs/conf.mk linux/fs/aufs/conf.mk
 +-include ${srctree}/${src}/conf_priv.mk
 diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 --- /usr/share/empty/fs/aufs/cpup.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/cpup.c	2026-10-19 08:28:44.909999820 +0200
-@@ -0,0 +1,1439 @@
++++ linux/fs/aufs/cpup.c	2026-11-24 08:11:36.740753595 +0100
+@@ -0,0 +1,1437 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -4938,8 +4938,7 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +			di_read_unlock(parent, !AuLock_IR);
 +		} while (!h_parent);
 +
-+		if (d != real_parent)
-+			di_write_lock_child3(d);
++		di_write_lock_unless(d, real_parent, AuLsc_DI_CHILD3);
 +
 +		/* somebody else might create while we were sleeping */
 +		h_dentry = au_h_dptr(d, bdst);
@@ -4955,8 +4954,7 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +			}
 +		}
 +
-+		if (d != real_parent)
-+			di_write_unlock(d);
++		di_write_unlock_unless(d, real_parent);
 +		if (unlikely(err))
 +			break;
 +	}
@@ -5012,7 +5010,7 @@ diff -urN /usr/share/empty/fs/aufs/cpup.c linux/fs/aufs/cpup.c
 +}
 diff -urN /usr/share/empty/fs/aufs/cpup.h linux/fs/aufs/cpup.h
 --- /usr/share/empty/fs/aufs/cpup.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/cpup.h	2026-10-19 08:28:44.909999820 +0200
++++ linux/fs/aufs/cpup.h	2026-11-24 08:11:35.566714581 +0100
 @@ -0,0 +1,88 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -5104,8 +5102,8 @@ diff -urN /usr/share/empty/fs/aufs/cpup.h linux/fs/aufs/cpup.h
 +#endif /* __AUFS_CPUP_H__ */
 diff -urN /usr/share/empty/fs/aufs/dbgaufs.c linux/fs/aufs/dbgaufs.c
 --- /usr/share/empty/fs/aufs/dbgaufs.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dbgaufs.c	2026-10-19 08:28:44.909999820 +0200
-@@ -0,0 +1,512 @@
++++ linux/fs/aufs/dbgaufs.c	2026-11-24 08:11:36.740917443 +0100
+@@ -0,0 +1,513 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -5262,14 +5260,15 @@ diff -urN /usr/share/empty/fs/aufs/dbgaufs.c linux/fs/aufs/dbgaufs.c
 +		strscpy(p->a, str, sizeof(str));
 +#undef str
 +	}
-+	si_read_unlock(sb);
 +
 +	err = 0;
 +	file->private_data = p;
-+	goto out; /* success */
++	goto out_unlock; /* success */
 +
 +out_free:
 +	free_page((unsigned long)p);
++out_unlock:
++	si_read_unlock(sb);
 +out:
 +	return err;
 +}
@@ -5620,7 +5619,7 @@ diff -urN /usr/share/empty/fs/aufs/dbgaufs.c linux/fs/aufs/dbgaufs.c
 +}
 diff -urN /usr/share/empty/fs/aufs/dbgaufs.h linux/fs/aufs/dbgaufs.h
 --- /usr/share/empty/fs/aufs/dbgaufs.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dbgaufs.h	2026-10-19 08:28:44.909999820 +0200
++++ linux/fs/aufs/dbgaufs.h	2026-11-24 08:11:35.567128506 +0100
 @@ -0,0 +1,40 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -5664,7 +5663,7 @@ diff -urN /usr/share/empty/fs/aufs/dbgaufs.h linux/fs/aufs/dbgaufs.h
 +#endif /* __DBGAUFS_H__ */
 diff -urN /usr/share/empty/fs/aufs/dcsub.c linux/fs/aufs/dcsub.c
 --- /usr/share/empty/fs/aufs/dcsub.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dcsub.c	2026-10-19 08:28:44.909999820 +0200
++++ linux/fs/aufs/dcsub.c	2026-11-24 08:11:35.567241145 +0100
 @@ -0,0 +1,212 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -5880,7 +5879,7 @@ diff -urN /usr/share/empty/fs/aufs/dcsub.c linux/fs/aufs/dcsub.c
 +}
 diff -urN /usr/share/empty/fs/aufs/dcsub.h linux/fs/aufs/dcsub.h
 --- /usr/share/empty/fs/aufs/dcsub.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dcsub.h	2026-10-19 08:28:44.909999820 +0200
++++ linux/fs/aufs/dcsub.h	2026-11-24 08:11:35.567346007 +0100
 @@ -0,0 +1,126 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -6010,7 +6009,7 @@ diff -urN /usr/share/empty/fs/aufs/dcsub.h linux/fs/aufs/dcsub.h
 +#endif /* __AUFS_DCSUB_H__ */
 diff -urN /usr/share/empty/fs/aufs/debug.c linux/fs/aufs/debug.c
 --- /usr/share/empty/fs/aufs/debug.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/debug.c	2026-10-19 08:28:44.909999820 +0200
++++ linux/fs/aufs/debug.c	2026-11-24 08:11:35.567494554 +0100
 @@ -0,0 +1,435 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -6449,7 +6448,7 @@ diff -urN /usr/share/empty/fs/aufs/debug.c linux/fs/aufs/debug.c
 +}
 diff -urN /usr/share/empty/fs/aufs/debug.h linux/fs/aufs/debug.h
 --- /usr/share/empty/fs/aufs/debug.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/debug.h	2026-10-19 08:28:44.909999820 +0200
++++ linux/fs/aufs/debug.h	2026-11-24 08:11:35.567631924 +0100
 @@ -0,0 +1,213 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -6666,8 +6665,8 @@ diff -urN /usr/share/empty/fs/aufs/debug.h linux/fs/aufs/debug.h
 +#endif /* __AUFS_DEBUG_H__ */
 diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
 --- /usr/share/empty/fs/aufs/dentry.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dentry.c	2026-10-19 08:28:44.913333152 +0200
-@@ -0,0 +1,1217 @@
++++ linux/fs/aufs/dentry.c	2026-11-24 08:11:36.741192296 +0100
+@@ -0,0 +1,1215 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -7715,8 +7714,7 @@ diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
 +			d = parent;
 +		}
 +
-+		if (d != dentry)
-+			di_write_lock_child2(d);
++		di_write_lock_unless(d, dentry, AuLsc_DI_CHILD2);
 +
 +		/* someone might update our dentry while we were sleeping */
 +		if (au_digen_test(d, sigen)) {
@@ -7729,8 +7727,7 @@ diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
 +			di_read_unlock(parent, AuLock_IR);
 +		}
 +
-+		if (d != dentry)
-+			di_write_unlock(d);
++		di_write_unlock_unless(d, dentry);
 +		dput(parent);
 +		if (unlikely(err))
 +			break;
@@ -7887,8 +7884,8 @@ diff -urN /usr/share/empty/fs/aufs/dentry.c linux/fs/aufs/dentry.c
 +};
 diff -urN /usr/share/empty/fs/aufs/dentry.h linux/fs/aufs/dentry.h
 --- /usr/share/empty/fs/aufs/dentry.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dentry.h	2026-10-19 08:28:44.913333152 +0200
-@@ -0,0 +1,258 @@
++++ linux/fs/aufs/dentry.h	2026-11-24 08:11:36.741352677 +0100
+@@ -0,0 +1,276 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -8050,6 +8047,24 @@ diff -urN /usr/share/empty/fs/aufs/dentry.h linux/fs/aufs/dentry.h
 +#undef AuWriteLockFunc
 +#undef AuRWLockFuncs
 +
++/*
++ * write-lock/unlock the dinfo of @d unless it is @held, whose dinfo the
++ * caller already holds.  Used while walking up the ancestors.
++ */
++static inline void di_write_lock_unless(struct dentry *d, struct dentry *held,
++					unsigned int lsc)
++{
++	if (d != held)
++		di_write_lock(d, lsc);
++}
++
++static inline void di_write_unlock_unless(struct dentry *d,
++					  struct dentry *held)
++{
++	if (d != held)
++		di_write_unlock(d);
++}
++
 +#define DiMustNoWaiters(d)	AuRwMustNoWaiters(&au_di(d)->di_rwsem)
 +#define DiMustAnyLock(d)	AuRwMustAnyLock(&au_di(d)->di_rwsem)
 +#define DiMustWriteLock(d)	AuRwMustWriteLock(&au_di(d)->di_rwsem)
@@ -8149,7 +8164,7 @@ diff -urN /usr/share/empty/fs/aufs/dentry.h linux/fs/aufs/dentry.h
 +#endif /* __AUFS_DENTRY_H__ */
 diff -urN /usr/share/empty/fs/aufs/dinfo.c linux/fs/aufs/dinfo.c
 --- /usr/share/empty/fs/aufs/dinfo.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dinfo.c	2026-10-19 08:28:44.913333152 +0200
++++ linux/fs/aufs/dinfo.c	2026-11-24 08:11:35.568242901 +0100
 @@ -0,0 +1,544 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -8697,8 +8712,8 @@ diff -urN /usr/share/empty/fs/aufs/dinfo.c linux/fs/aufs/dinfo.c
 +}
 diff -urN /usr/share/empty/fs/aufs/dir.c linux/fs/aufs/dir.c
 --- /usr/share/empty/fs/aufs/dir.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dir.c	2026-10-19 08:28:44.913333152 +0200
-@@ -0,0 +1,752 @@
++++ linux/fs/aufs/dir.c	2026-11-24 08:11:36.741560324 +0100
+@@ -0,0 +1,719 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -9070,34 +9085,6 @@ diff -urN /usr/share/empty/fs/aufs/dir.c linux/fs/aufs/dir.c
 +
 +/* ---------------------------------------------------------------------- */
 +
-+static int au_do_fsync_dir_no_file(struct dentry *dentry, int datasync)
-+{
-+	int err;
-+	aufs_bindex_t bbot, bindex;
-+	struct inode *inode;
-+	struct super_block *sb;
-+
-+	err = 0;
-+	sb = dentry->d_sb;
-+	inode = d_inode(dentry);
-+	IMustLock(inode);
-+	bbot = au_dbbot(dentry);
-+	for (bindex = au_dbtop(dentry); !err && bindex <= bbot; bindex++) {
-+		struct path h_path;
-+
-+		if (au_test_ro(sb, bindex, inode))
-+			continue;
-+		h_path.dentry = au_h_dptr(dentry, bindex);
-+		if (!h_path.dentry)
-+			continue;
-+
-+		h_path.mnt = au_sbr_mnt(sb, bindex);
-+		err = vfsub_fsync(NULL, &h_path, datasync);
-+	}
-+
-+	return err;
-+}
-+
 +static int au_do_fsync_dir(struct file *file, int datasync)
 +{
 +	int err;
@@ -9106,10 +9093,7 @@ diff -urN /usr/share/empty/fs/aufs/dir.c linux/fs/aufs/dir.c
 +	struct super_block *sb;
 +	struct inode *inode;
 +
-+	err = au_reval_and_lock_fdi(file, reopen_dir, /*wlock*/1, /*fi_lsc*/0);
-+	if (unlikely(err))
-+		goto out;
-+
++	err = 0;
 +	inode = file_inode(file);
 +	sb = inode->i_sb;
 +	bbot = au_fbbot_dir(file);
@@ -9121,7 +9105,6 @@ diff -urN /usr/share/empty/fs/aufs/dir.c linux/fs/aufs/dir.c
 +		err = vfsub_fsync(h_file, &h_file->f_path, datasync);
 +	}
 +
-+out:
 +	return err;
 +}
 +
@@ -9142,17 +9125,16 @@ diff -urN /usr/share/empty/fs/aufs/dir.c linux/fs/aufs/dir.c
 +	inode_lock(inode);
 +	sb = dentry->d_sb;
 +	si_noflush_read_lock(sb);
-+	if (file)
-+		err = au_do_fsync_dir(file, datasync);
-+	else {
-+		di_write_lock_child(dentry);
-+		err = au_do_fsync_dir_no_file(dentry, datasync);
-+	}
++	/* unlocks finfo and dinfo by itself on error */
++	err = au_reval_and_lock_fdi(file, reopen_dir, /*wlock*/1, /*fi_lsc*/0);
++	if (unlikely(err))
++		goto out;
++	err = au_do_fsync_dir(file, datasync);
 +	au_cpup_attr_timesizes(inode);
 +	di_write_unlock(dentry);
-+	if (file)
-+		fi_write_unlock(file);
++	fi_write_unlock(file);
 +
++out:
 +	si_read_unlock(sb);
 +	inode_unlock(inode);
 +	return err;
@@ -9453,7 +9435,7 @@ diff -urN /usr/share/empty/fs/aufs/dir.c linux/fs/aufs/dir.c
 +};
 diff -urN /usr/share/empty/fs/aufs/dir.h linux/fs/aufs/dir.h
 --- /usr/share/empty/fs/aufs/dir.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dir.h	2026-10-19 08:28:44.913333152 +0200
++++ linux/fs/aufs/dir.h	2026-11-24 08:11:35.568422118 +0100
 @@ -0,0 +1,121 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -9578,7 +9560,7 @@ diff -urN /usr/share/empty/fs/aufs/dir.h linux/fs/aufs/dir.h
 +#endif /* __AUFS_DIR_H__ */
 diff -urN /usr/share/empty/fs/aufs/dirren.c linux/fs/aufs/dirren.c
 --- /usr/share/empty/fs/aufs/dirren.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dirren.c	2026-10-19 08:28:44.913333152 +0200
++++ linux/fs/aufs/dirren.c	2026-11-24 08:11:35.568864404 +0100
 @@ -0,0 +1,1293 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -10875,7 +10857,7 @@ diff -urN /usr/share/empty/fs/aufs/dirren.c linux/fs/aufs/dirren.c
 +}
 diff -urN /usr/share/empty/fs/aufs/dirren.h linux/fs/aufs/dirren.h
 --- /usr/share/empty/fs/aufs/dirren.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dirren.h	2026-10-19 08:28:44.913333152 +0200
++++ linux/fs/aufs/dirren.h	2026-11-24 08:11:35.570361448 +0100
 @@ -0,0 +1,127 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -11006,7 +10988,7 @@ diff -urN /usr/share/empty/fs/aufs/dirren.h linux/fs/aufs/dirren.h
 +#endif /* __AUFS_DIRREN_H__ */
 diff -urN /usr/share/empty/fs/aufs/dynop.c linux/fs/aufs/dynop.c
 --- /usr/share/empty/fs/aufs/dynop.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dynop.c	2026-10-19 08:28:44.913333152 +0200
++++ linux/fs/aufs/dynop.c	2026-11-24 08:11:35.570489638 +0100
 @@ -0,0 +1,350 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -11360,7 +11342,7 @@ diff -urN /usr/share/empty/fs/aufs/dynop.c linux/fs/aufs/dynop.c
 +}
 diff -urN /usr/share/empty/fs/aufs/dynop.h linux/fs/aufs/dynop.h
 --- /usr/share/empty/fs/aufs/dynop.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/dynop.h	2026-10-19 08:28:44.913333152 +0200
++++ linux/fs/aufs/dynop.h	2026-11-24 08:11:35.570598130 +0100
 @@ -0,0 +1,64 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -11428,8 +11410,8 @@ diff -urN /usr/share/empty/fs/aufs/dynop.h linux/fs/aufs/dynop.h
 +#endif /* __AUFS_DYNOP_H__ */
 diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 --- /usr/share/empty/fs/aufs/export.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/export.c	2026-10-19 08:28:44.913333152 +0200
-@@ -0,0 +1,827 @@
++++ linux/fs/aufs/export.c	2026-11-24 08:11:36.741779290 +0100
+@@ -0,0 +1,851 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -11731,17 +11713,15 @@ diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 +struct au_nfsd_si_lock {
 +	unsigned int sigen;
 +	aufs_bindex_t bindex, br_id;
-+	unsigned char force_lock;
 +};
 +
-+static int si_nfsd_read_lock(struct super_block *sb,
-+			     struct au_nfsd_si_lock *nsi_lock)
++/* called with si_rwsem read-locked */
++static int si_nfsd_test_br(struct super_block *sb,
++			   struct au_nfsd_si_lock *nsi_lock)
 +{
 +	int err;
 +	aufs_bindex_t bindex;
 +
-+	si_read_lock(sb, AuLock_FLUSH);
-+
 +	/* branch id may be wrapped around */
 +	err = 0;
 +	bindex = au_br_index(sb, nsi_lock->br_id);
@@ -11750,14 +11730,37 @@ diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 +
 +	err = -ESTALE;
 +	bindex = -1;
-+	if (!nsi_lock->force_lock)
-+		si_read_unlock(sb);
 +
 +out:
 +	nsi_lock->bindex = bindex;
 +	return err;
 +}
 +
++/* returns 0 with si_rwsem read-locked, or -ESTALE with nothing locked */
++static int si_nfsd_read_lock(struct super_block *sb,
++			     struct au_nfsd_si_lock *nsi_lock)
++{
++	int err;
++
++	si_read_lock(sb, AuLock_FLUSH);
++	err = si_nfsd_test_br(sb, nsi_lock);
++	if (unlikely(err))
++		si_read_unlock(sb);
++
++	return err;
++}
++
++/*
++ * re-acquire si_rwsem after it was released temporarily.  Returns with it
++ * read-locked even if the branch has gone (-ESTALE).
++ */
++static int si_nfsd_relock(struct super_block *sb,
++			  struct au_nfsd_si_lock *nsi_lock)
++{
++	si_read_lock(sb, AuLock_FLUSH);
++	return si_nfsd_test_br(sb, nsi_lock);
++}
++
 +struct find_name_by_ino {
 +	struct dir_context ctx;
 +	int called, found;
@@ -11783,8 +11786,8 @@ diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 +	return false;
 +}
 +
-+static struct dentry *au_lkup_by_ino(struct path *path, ino_t ino,
-+				     struct au_nfsd_si_lock *nsi_lock)
++/* look up the entry whose inode number is @ino in the dir @path */
++static struct dentry *au_do_lkup_by_ino(struct path *path, ino_t ino)
 +{
 +	struct dentry *dentry, *parent;
 +	struct file *file;
@@ -11797,8 +11800,6 @@ diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 +	int err;
 +
 +	parent = path->dentry;
-+	if (nsi_lock)
-+		si_read_unlock(parent->d_sb);
 +	file = vfsub_dentry_open(path, au_dir_roflags);
 +	dentry = (void *)file;
 +	if (IS_ERR(file))
@@ -11840,12 +11841,23 @@ diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 +out_file:
 +	fput(file);
 +out:
-+	if (unlikely(nsi_lock
-+		     && si_nfsd_read_lock(parent->d_sb, nsi_lock) < 0))
-+		if (!IS_ERR(dentry)) {
-+			dput(dentry);
-+			dentry = ERR_PTR(-ESTALE);
-+		}
++	AuTraceErrPtr(dentry);
++	return dentry;
++}
++
++/* called with si_rwsem read-locked, which is released during the lookup */
++static struct dentry *au_lkup_by_ino(struct path *path, ino_t ino,
++				     struct au_nfsd_si_lock *nsi_lock)
++{
++	struct dentry *dentry;
++	struct super_block *sb = path->dentry->d_sb;
++
++	si_read_unlock(sb);
++	dentry = au_do_lkup_by_ino(path, ino);
++	if (unlikely(si_nfsd_relock(sb, nsi_lock) < 0) && !IS_ERR(dentry)) {
++		dput(dentry);
++		dentry = ERR_PTR(-ESTALE);
++	}
 +	AuTraceErrPtr(dentry);
 +	return dentry;
 +}
@@ -11986,18 +11998,17 @@ diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 +		goto out_path;
 +
 +	if (ino != d_inode(path.dentry)->i_ino)
-+		dentry = au_lkup_by_ino(&path, ino, /*nsi_lock*/NULL);
++		dentry = au_do_lkup_by_ino(&path, ino);
 +	else
 +		dentry = dget(path.dentry);
 +
 +out_path:
 +	path_put(&path);
 +out_relock:
-+	if (unlikely(si_nfsd_read_lock(sb, nsi_lock) < 0))
-+		if (!IS_ERR(dentry)) {
-+			dput(dentry);
-+			dentry = ERR_PTR(-ESTALE);
-+		}
++	if (unlikely(si_nfsd_relock(sb, nsi_lock) < 0) && !IS_ERR(dentry)) {
++		dput(dentry);
++		dentry = ERR_PTR(-ESTALE);
++	}
 +out_pathname:
 +	free_page((unsigned long)pathname);
 +out_h_parent:
@@ -12017,9 +12028,7 @@ diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 +	__u32 *fh = fid->raw;
 +	struct au_branch *br;
 +	ino_t ino, dir_ino;
-+	struct au_nfsd_si_lock nsi_lock = {
-+		.force_lock	= 0
-+	};
++	struct au_nfsd_si_lock nsi_lock = {};
 +
 +	dentry = ERR_PTR(-ESTALE);
 +	/* it should never happen, but the file handle is unreliable */
@@ -12032,7 +12041,6 @@ diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 +	br = NULL;
 +	if (unlikely(si_nfsd_read_lock(sb, &nsi_lock)))
 +		goto out;
-+	nsi_lock.force_lock = 1;
 +
 +	/* is this inode still cached? */
 +	ino = decode_ino(fh + Fh_ino);
@@ -12129,9 +12137,7 @@ diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 +
 +	h_parent = NULL;
 +	sb = inode->i_sb;
-+	err = si_read_lock(sb, AuLock_FLUSH);
-+	if (unlikely(err))
-+		goto out;
++	si_read_lock(sb, AuLock_FLUSH);
 +
 +#ifdef CONFIG_AUFS_DEBUG
 +	if (unlikely(!au_opt_test(au_mntflags(sb), XINO)))
@@ -12259,8 +12265,8 @@ diff -urN /usr/share/empty/fs/aufs/export.c linux/fs/aufs/export.c
 +}
 diff -urN /usr/share/empty/fs/aufs/fhsm.c linux/fs/aufs/fhsm.c
 --- /usr/share/empty/fs/aufs/fhsm.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/fhsm.c	2026-10-19 08:28:44.913333152 +0200
-@@ -0,0 +1,413 @@
++++ linux/fs/aufs/fhsm.c	2026-11-24 08:11:36.742226073 +0100
+@@ -0,0 +1,408 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2011-2026 Junjiro R. Okajima
@@ -12335,8 +12341,9 @@ diff -urN /usr/share/empty/fs/aufs/fhsm.c linux/fs/aufs/fhsm.c
 +	}
 +}
 +
++/* called with br->br_fhsm->bf_lock held */
 +static int au_fhsm_stfs(struct super_block *sb, aufs_bindex_t bindex,
-+			struct aufs_stfs *rstfs, int do_lock, int do_notify)
++			struct aufs_stfs *rstfs, int do_notify)
 +{
 +	int err;
 +	struct au_branch *br;
@@ -12347,10 +12354,7 @@ diff -urN /usr/share/empty/fs/aufs/fhsm.c linux/fs/aufs/fhsm.c
 +	bf = br->br_fhsm;
 +	AuDebugOn(!bf);
 +
-+	if (do_lock)
-+		mutex_lock(&bf->bf_lock);
-+	else
-+		MtxMustLock(&bf->bf_lock);
++	MtxMustLock(&bf->bf_lock);
 +
 +	/* sb->s_root for NFS is unreliable */
 +	err = au_br_stfs(br, &bf->bf_stfs);
@@ -12367,8 +12371,6 @@ diff -urN /usr/share/empty/fs/aufs/fhsm.c linux/fs/aufs/fhsm.c
 +		*rstfs = bf->bf_stfs;
 +
 +out:
-+	if (do_lock)
-+		mutex_unlock(&bf->bf_lock);
 +	au_fhsm_notify(sb, /*val*/1);
 +
 +	return err;
@@ -12398,8 +12400,7 @@ diff -urN /usr/share/empty/fs/aufs/fhsm.c linux/fs/aufs/fhsm.c
 +	if (force
 +	    || au_fhsm_pid(fhsm)
 +	    || au_fhsm_test_jiffy(sbinfo, br))
-+		err = au_fhsm_stfs(sb, bindex, /*rstfs*/NULL, /*do_lock*/0,
-+				  /*do_notify*/1);
++		err = au_fhsm_stfs(sb, bindex, /*rstfs*/NULL, /*do_notify*/1);
 +	mutex_unlock(&bf->bf_lock);
 +}
 +
@@ -12676,8 +12677,8 @@ diff -urN /usr/share/empty/fs/aufs/fhsm.c linux/fs/aufs/fhsm.c
 +}
 diff -urN /usr/share/empty/fs/aufs/file.c linux/fs/aufs/file.c
 --- /usr/share/empty/fs/aufs/file.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/file.c	2026-10-19 08:28:44.913333152 +0200
-@@ -0,0 +1,832 @@
++++ linux/fs/aufs/file.c	2026-11-24 08:11:36.742462615 +0100
+@@ -0,0 +1,846 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -12887,13 +12888,11 @@ diff -urN /usr/share/empty/fs/aufs/file.c linux/fs/aufs/file.c
 +	struct dentry *dentry;
 +	struct au_finfo *finfo;
 +
-+	if (!aopen)
-+		err = au_finfo_init(file, args->fidir);
-+	else {
++	if (aopen)
 +		lockdep_off();
-+		err = au_finfo_init(file, args->fidir);
++	err = au_finfo_init(file, args->fidir);
++	if (aopen)
 +		lockdep_on();
-+	}
 +	if (unlikely(err))
 +		goto out;
 +
@@ -12914,7 +12913,8 @@ diff -urN /usr/share/empty/fs/aufs/file.c linux/fs/aufs/file.c
 +			lockdep_on();
 +			di_read_unlock(dentry, AuLock_IR);
 +		}
-+	}
++	} else
++		di_write_unlock(dentry);
 +
 +	finfo = au_fi(file);
 +	if (!err) {
@@ -12922,13 +12922,11 @@ diff -urN /usr/share/empty/fs/aufs/file.c linux/fs/aufs/file.c
 +		au_hbl_add(&finfo->fi_hlist,
 +			   &au_sbi(file->f_path.dentry->d_sb)->si_files);
 +	}
-+	if (!aopen)
-+		fi_write_unlock(file);
-+	else {
++	if (aopen)
 +		lockdep_off();
-+		fi_write_unlock(file);
++	fi_write_unlock(file);
++	if (aopen)
 +		lockdep_on();
-+	}
 +	if (unlikely(err)) {
 +		finfo->fi_hdir = NULL;
 +		au_finfo_fin(file);
@@ -13124,10 +13122,10 @@ diff -urN /usr/share/empty/fs/aufs/file.c linux/fs/aufs/file.c
 +	    || !d_unhashed(cpg.dentry)	/* copyup and reopen */
 +		) {
 +		h_file = au_h_open_pre(cpg.dentry, cpg.bsrc, /*force_wr*/0);
++		di_downgrade_lock(parent, AuLock_IR);
 +		if (IS_ERR(h_file))
 +			err = PTR_ERR(h_file);
 +		else {
-+			di_downgrade_lock(parent, AuLock_IR);
 +			if (dbtop > cpg.bdst)
 +				err = au_sio_cpup_simple(&cpg);
 +			if (!err)
@@ -13381,9 +13379,14 @@ diff -urN /usr/share/empty/fs/aufs/file.c linux/fs/aufs/file.c
 +	return err;
 +}
 +
-+/* common function to regular file and dir */
-+int au_reval_and_lock_fdi(struct file *file, int (*reopen)(struct file *file),
-+			  int wlock, unsigned int fi_lsc)
++/*
++ * common function to regular file and dir.
++ * returns 0 with finfo and dinfo write-locked, or an error with nothing
++ * locked.
++ */
++static int au_do_reval_and_lock_fdi(struct file *file,
++				    int (*reopen)(struct file *file),
++				    unsigned int fi_lsc)
 +{
 +	int err;
 +	unsigned int sigen, figen;
@@ -13404,13 +13407,8 @@ diff -urN /usr/share/empty/fs/aufs/file.c linux/fs/aufs/file.c
 +		di_write_lock_child2(dentry);
 +	btop = au_dbtop(dentry);
 +	pseudo_link = (btop != au_ibtop(inode));
-+	if (sigen == figen && !pseudo_link && au_fbtop(file) == btop) {
-+		if (!wlock) {
-+			di_downgrade_lock(dentry, AuLock_IR);
-+			fi_downgrade_lock(file);
-+		}
++	if (sigen == figen && !pseudo_link && au_fbtop(file) == btop)
 +		goto out; /* success */
-+	}
 +
 +	AuDbg("sigen %d, figen %d\n", sigen, figen);
 +	if (au_digen_test(dentry, sigen)) {
@@ -13420,12 +13418,7 @@ diff -urN /usr/share/empty/fs/aufs/file.c linux/fs/aufs/file.c
 +
 +	if (!err)
 +		err = refresh_file(file, reopen);
-+	if (!err) {
-+		if (!wlock) {
-+			di_downgrade_lock(dentry, AuLock_IR);
-+			fi_downgrade_lock(file);
-+		}
-+	} else {
++	if (unlikely(err)) {
 +		di_write_unlock(dentry);
 +		fi_write_unlock(file);
 +	}
@@ -13434,6 +13427,28 @@ diff -urN /usr/share/empty/fs/aufs/file.c linux/fs/aufs/file.c
 +	return err;
 +}
 +
++int au_reval_and_write_lock_fdi(struct file *file,
++				int (*reopen)(struct file *file),
++				unsigned int fi_lsc)
++{
++	return au_do_reval_and_lock_fdi(file, reopen, fi_lsc);
++}
++
++int au_reval_and_read_lock_fdi(struct file *file,
++			       int (*reopen)(struct file *file),
++			       unsigned int fi_lsc)
++{
++	int err;
++
++	err = au_do_reval_and_lock_fdi(file, reopen, fi_lsc);
++	if (!err) {
++		di_downgrade_lock(file->f_path.dentry, AuLock_IR);
++		fi_downgrade_lock(file);
++	}
++
++	return err;
++}
++
 +/* ---------------------------------------------------------------------- */
 +
 +/* cf. aufs_nopage() */
@@ -13512,8 +13527,8 @@ diff -urN /usr/share/empty/fs/aufs/file.c linux/fs/aufs/file.c
 +};
 diff -urN /usr/share/empty/fs/aufs/file.h linux/fs/aufs/file.h
 --- /usr/share/empty/fs/aufs/file.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/file.h	2026-10-19 08:28:44.913333152 +0200
-@@ -0,0 +1,324 @@
++++ linux/fs/aufs/file.h	2026-11-24 08:11:36.742626718 +0100
+@@ -0,0 +1,350 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -13591,8 +13606,34 @@ diff -urN /usr/share/empty/fs/aufs/file.h linux/fs/aufs/file.h
 +int au_reopen_nondir(struct file *file);
 +struct au_pin;
 +int au_ready_to_write(struct file *file, loff_t len, struct au_pin *pin);
-+int au_reval_and_lock_fdi(struct file *file, int (*reopen)(struct file *file),
-+			  int wlock, unsigned int fi_lsc);
++/* return 0 with finfo and dinfo locked, or an error with nothing locked */
++int au_reval_and_read_lock_fdi(struct file *file,
++			       int (*reopen)(struct file *file),
++			       unsigned int fi_lsc);
++int au_reval_and_write_lock_fdi(struct file *file,
++				int (*reopen)(struct file *file),
++				unsigned int fi_lsc);
++
++/*
++ * Entry point.  @wlock must be a constant, which selects the function at
++ * compile time.  Returns 0 with the finfo and dinfo locked, or an error
++ * with nothing held.
++ */
++#define au_reval_and_lock_fdi(__file, __reopen, __wlock, __lsc) ({	\
++	struct file *_file = (__file);					\
++	int (*_reopen)(struct file *) = (__reopen);			\
++	const int _wlock = (__wlock);					\
++	unsigned int _lsc = (__lsc);					\
++	int _err;							\
++									\
++	BUILD_BUG_ON(!__builtin_constant_p(__wlock));			\
++	if (_wlock)							\
++		_err = au_reval_and_write_lock_fdi(_file, _reopen, _lsc); \
++	else								\
++		_err = au_reval_and_read_lock_fdi(_file, _reopen, _lsc); \
++	_err;								\
++})
++
 +int au_do_flush(struct file *file, fl_owner_t id,
 +		int (*flush)(struct file *file, fl_owner_t id));
 +
@@ -13618,7 +13659,7 @@ diff -urN /usr/share/empty/fs/aufs/file.h linux/fs/aufs/file.h
 +extern const struct file_operations aufs_file_fop;
 +int au_do_open_nondir(struct file *file, int flags, struct file *h_file);
 +int aufs_release_nondir(struct inode *inode __maybe_unused, struct file *file);
-+struct file *au_read_pre(struct file *file, int keep_fi, unsigned int lsc);
++struct file *au_read_pre(struct file *file, unsigned int lsc);
 +
 +/* mf.c */
 +void au_mf_add(struct file *h_file, struct file *file);
@@ -13840,7 +13881,7 @@ diff -urN /usr/share/empty/fs/aufs/file.h linux/fs/aufs/file.h
 +#endif /* __AUFS_FILE_H__ */
 diff -urN /usr/share/empty/fs/aufs/finfo.c linux/fs/aufs/finfo.c
 --- /usr/share/empty/fs/aufs/finfo.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/finfo.c	2026-10-19 08:28:44.913333152 +0200
++++ linux/fs/aufs/finfo.c	2026-11-24 08:11:35.571520758 +0100
 @@ -0,0 +1,135 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -13979,8 +14020,8 @@ diff -urN /usr/share/empty/fs/aufs/finfo.c linux/fs/aufs/finfo.c
 +}
 diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 --- /usr/share/empty/fs/aufs/f_op.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/f_op.c	2026-10-19 08:28:44.913333152 +0200
-@@ -0,0 +1,823 @@
++++ linux/fs/aufs/f_op.c	2026-11-24 08:11:36.742047404 +0100
+@@ -0,0 +1,833 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -14125,20 +14166,39 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 + * read functions after [fdi]_rwsem are released, but it should be harmless.
 + */
 +
-+/* Callers should call au_read_post() or fput() in the end */
-+struct file *au_read_pre(struct file *file, int keep_fi, unsigned int lsc)
++/*
++ * returns 0 with the finfo read-locked and a reference of the top branch
++ * file in *h_file, or an error with nothing locked.
++ * Callers should call fi_read_unlock() and au_read_post() in the end.
++ */
++static int au_read_pre_keep_fi(struct file *file, unsigned int lsc,
++			       struct file **h_file)
 +{
-+	struct file *h_file;
 +	int err;
 +
 +	err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/0, lsc);
 +	if (!err) {
 +		di_read_unlock(file->f_path.dentry, AuLock_IR);
-+		h_file = au_hf_top(file);
-+		get_file(h_file);
-+		if (!keep_fi)
-+			fi_read_unlock(file);
-+	} else
++		*h_file = au_hf_top(file);
++		get_file(*h_file);
++	}
++
++	return err;
++}
++
++/*
++ * returns a reference of the top branch file, or an error.  No aufs lock is
++ * held on return.  Callers should call au_read_post() or fput() in the end.
++ */
++struct file *au_read_pre(struct file *file, unsigned int lsc)
++{
++	int err;
++	struct file *h_file;
++
++	err = au_read_pre_keep_fi(file, lsc, &h_file);
++	if (!err)
++		fi_read_unlock(file);
++	else
 +		h_file = ERR_PTR(err);
 +
 +	return h_file;
@@ -14161,14 +14221,14 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +};
 +
 +/*
-+ * return with iinfo is write-locked
-+ * callers should call au_write_post() or iinfo_write_unlock() + fput() in the
-+ * end
++ * returns 0 with the iinfo write-locked and a reference of the top branch
++ * file in *h_file, or an error with nothing locked.
++ * callers should call au_write_post() or ii_write_unlock() + fput() in the
++ * end.
 + */
-+static struct file *au_write_pre(struct file *file, int do_ready,
-+				 struct au_write_pre *wpre)
++static int au_write_pre(struct file *file, int do_ready,
++			struct au_write_pre *wpre, struct file **h_file)
 +{
-+	struct file *h_file;
 +	struct dentry *dentry;
 +	int err;
 +	unsigned int lsc;
@@ -14178,7 +14238,6 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +	if (wpre)
 +		lsc = wpre->lsc;
 +	err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1, lsc);
-+	h_file = ERR_PTR(err);
 +	if (unlikely(err))
 +		goto out;
 +
@@ -14186,7 +14245,6 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +	if (do_ready) {
 +		err = au_ready_to_write(file, -1, &pin);
 +		if (unlikely(err)) {
-+			h_file = ERR_PTR(err);
 +			di_write_unlock(dentry);
 +			goto out_fi;
 +		}
@@ -14195,20 +14253,20 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +	di_downgrade_lock(dentry, /*flags*/0);
 +	if (wpre)
 +		wpre->btop = au_fbtop(file);
-+	h_file = au_hf_top(file);
-+	get_file(h_file);
++	*h_file = au_hf_top(file);
++	get_file(*h_file);
 +	if (wpre)
-+		wpre->blks = file_inode(h_file)->i_blocks;
++		wpre->blks = file_inode(*h_file)->i_blocks;
 +	if (do_ready)
 +		au_unpin(&pin);
 +	di_read_unlock(dentry, /*flags*/0);
 +	if (do_ready)
-+		vfsub_file_start_write(h_file);
++		vfsub_file_start_write(*h_file);
 +
 +out_fi:
 +	fi_write_unlock(file);
 +out:
-+	return h_file;
++	return err;
 +}
 +
 +static void au_write_post(struct inode *inode, struct file *h_file,
@@ -14301,9 +14359,8 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +	sb = inode->i_sb;
 +	si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW);
 +
-+	h_file = au_read_pre(file, /*keep_fi*/1, /*lsc*/0);
-+	err = PTR_ERR(h_file);
-+	if (IS_ERR(h_file))
++	err = au_read_pre_keep_fi(file, /*lsc*/0, &h_file);
++	if (unlikely(err))
 +		goto out;
 +
 +	if (au_test_loopback_kthread()) {
@@ -14337,9 +14394,8 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +	au_mtx_and_read_lock(inode);
 +
 +	wpre.lsc = 0;
-+	h_file = au_write_pre(file, /*do_ready*/1, &wpre);
-+	err = PTR_ERR(h_file);
-+	if (IS_ERR(h_file))
++	err = au_write_pre(file, /*do_ready*/1, &wpre, &h_file);
++	if (unlikely(err))
 +		goto out;
 +	if (!is_sync_kiocb(kio)) {
 +		/* .vs. sb_start_write() in aio_write() */
@@ -14378,7 +14434,7 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +	sb = inode->i_sb;
 +	si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW);
 +
-+	h_file = au_read_pre(file, /*keep_fi*/0, /*lsc*/0);
++	h_file = au_read_pre(file, /*lsc*/0);
 +	err = PTR_ERR(h_file);
 +	if (IS_ERR(h_file))
 +		goto out;
@@ -14406,9 +14462,8 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +	au_mtx_and_read_lock(inode);
 +
 +	wpre.lsc = 0;
-+	h_file = au_write_pre(file, /*do_ready*/1, &wpre);
-+	err = PTR_ERR(h_file);
-+	if (IS_ERR(h_file))
++	err = au_write_pre(file, /*do_ready*/1, &wpre, &h_file);
++	if (unlikely(err))
 +		goto out;
 +
 +	err = vfsub_splice_from(pipe, h_file, ppos, len, flags);
@@ -14432,9 +14487,8 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +	au_mtx_and_read_lock(inode);
 +
 +	wpre.lsc = 0;
-+	h_file = au_write_pre(file, /*do_ready*/1, &wpre);
-+	err = PTR_ERR(h_file);
-+	if (IS_ERR(h_file))
++	err = au_write_pre(file, /*do_ready*/1, &wpre, &h_file);
++	if (unlikely(err))
 +		goto out;
 +
 +	lockdep_off();
@@ -14481,28 +14535,25 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +	 * use f_path.dentry for this comparison.
 +	 */
 +	if (src->f_path.dentry < dst->f_path.dentry) {
-+		a_src.h_file = au_read_pre(src, /*keep_fi*/1, AuLsc_FI_1);
-+		err = PTR_ERR(a_src.h_file);
-+		if (IS_ERR(a_src.h_file))
++		err = au_read_pre_keep_fi(src, AuLsc_FI_1, &a_src.h_file);
++		if (unlikely(err))
 +			goto out_si;
 +
 +		wpre.lsc = AuLsc_FI_2;
-+		a_dst.h_file = au_write_pre(dst, /*do_ready*/1, &wpre);
-+		err = PTR_ERR(a_dst.h_file);
-+		if (IS_ERR(a_dst.h_file)) {
++		err = au_write_pre(dst, /*do_ready*/1, &wpre, &a_dst.h_file);
++		if (unlikely(err)) {
++			fi_read_unlock(src);
 +			au_read_post(a_src.inode, a_src.h_file);
 +			goto out_si;
 +		}
 +	} else {
 +		wpre.lsc = AuLsc_FI_1;
-+		a_dst.h_file = au_write_pre(dst, /*do_ready*/1, &wpre);
-+		err = PTR_ERR(a_dst.h_file);
-+		if (IS_ERR(a_dst.h_file))
++		err = au_write_pre(dst, /*do_ready*/1, &wpre, &a_dst.h_file);
++		if (unlikely(err))
 +			goto out_si;
 +
-+		a_src.h_file = au_read_pre(src, /*keep_fi*/1, AuLsc_FI_2);
-+		err = PTR_ERR(a_src.h_file);
-+		if (IS_ERR(a_src.h_file)) {
++		err = au_read_pre_keep_fi(src, AuLsc_FI_2, &a_src.h_file);
++		if (unlikely(err)) {
 +			au_write_post(a_dst.inode, a_dst.h_file, &wpre,
 +				      /*written*/0);
 +			goto out_si;
@@ -14542,6 +14593,7 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +		       unsigned long len, unsigned long pgoff,
 +		       unsigned long flags)
 +{
++	int err;
 +	unsigned long ul;
 +	const unsigned char wlock = !!(file->f_mode & FMODE_WRITE);
 +	struct inode *inode;
@@ -14556,11 +14608,12 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +	lockdep_off();
 +	si_read_lock(sb, AuLock_NOPLMW);
 +
-+	h_file = au_write_pre(file, /*do_ready*/wlock, /*wpre*/NULL);
++	err = au_write_pre(file, /*do_ready*/wlock, /*wpre*/NULL, &h_file);
 +	lockdep_on();
-+	ul = PTR_ERR(h_file);
-+	if (IS_ERR(h_file))
++	if (unlikely(err)) {
++		ul = err;
 +		goto out;
++	}
 +
 +	guma = h_file->f_op->get_unmapped_area;
 +	if (!guma)
@@ -14651,10 +14704,9 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +	lockdep_off();
 +	si_read_lock(sb, AuLock_NOPLMW);
 +
-+	h_file = au_write_pre(file, /*do_ready*/wlock, /*wpre*/NULL);
++	err = au_write_pre(file, /*do_ready*/wlock, /*wpre*/NULL, &h_file);
 +	lockdep_on();
-+	err = PTR_ERR(h_file);
-+	if (IS_ERR(h_file))
++	if (unlikely(err))
 +		goto out;
 +
 +	err = 0;
@@ -14708,9 +14760,8 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +	au_mtx_and_read_lock(inode);
 +
 +	wpre.lsc = 0;
-+	h_file = au_write_pre(file, /*do_ready*/1, &wpre);
-+	err = PTR_ERR(h_file);
-+	if (IS_ERR(h_file))
++	err = au_write_pre(file, /*do_ready*/1, &wpre, &h_file);
++	if (unlikely(err))
 +		goto out_unlock;
 +
 +	err = vfsub_fsync(h_file, &h_file->f_path, datasync);
@@ -14732,7 +14783,7 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +	sb = file->f_path.dentry->d_sb;
 +	si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW);
 +
-+	h_file = au_read_pre(file, /*keep_fi*/0, /*lsc*/0);
++	h_file = au_read_pre(file, /*lsc*/0);
 +	err = PTR_ERR(h_file);
 +	if (IS_ERR(h_file))
 +		goto out;
@@ -14755,7 +14806,7 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +	sb = file->f_path.dentry->d_sb;
 +	si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW);
 +
-+	h_file = au_read_pre(file, /*keep_fi*/0, /*lsc*/0);
++	h_file = au_read_pre(file, /*lsc*/0);
 +	err = PTR_ERR(h_file);
 +	if (IS_ERR(h_file))
 +		goto out;
@@ -14806,8 +14857,8 @@ diff -urN /usr/share/empty/fs/aufs/f_op.c linux/fs/aufs/f_op.c
 +};
 diff -urN /usr/share/empty/fs/aufs/fsctx.c linux/fs/aufs/fsctx.c
 --- /usr/share/empty/fs/aufs/fsctx.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/fsctx.c	2026-10-19 08:28:44.913333152 +0200
-@@ -0,0 +1,1234 @@
++++ linux/fs/aufs/fsctx.c	2026-11-24 08:11:36.742868106 +0100
+@@ -0,0 +1,1233 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2022-2026 Junjiro R. Okajima
@@ -14855,8 +14906,7 @@ diff -urN /usr/share/empty/fs/aufs/fsctx.c linux/fs/aufs/fsctx.c
 +
 +	AuDbg("fc %p\n", fc);
 +
-+	root = fc->root;
-+	sb = root->d_sb;
++	sb = fc->root->d_sb;
 +	root = sb->s_root; /* "bind"-mount may give us non-root */
 +	AuDebugOn(!IS_ROOT(root));
 +	err = si_write_lock(sb, AuLock_FLUSH | AuLock_NOPLM);
@@ -16044,7 +16094,7 @@ diff -urN /usr/share/empty/fs/aufs/fsctx.c linux/fs/aufs/fsctx.c
 +}
 diff -urN /usr/share/empty/fs/aufs/fstype.h linux/fs/aufs/fstype.h
 --- /usr/share/empty/fs/aufs/fstype.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/fstype.h	2026-10-19 08:28:44.916666486 +0200
++++ linux/fs/aufs/fstype.h	2026-11-24 08:11:35.572003511 +0100
 @@ -0,0 +1,406 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -16454,7 +16504,7 @@ diff -urN /usr/share/empty/fs/aufs/fstype.h linux/fs/aufs/fstype.h
 +#endif /* __AUFS_FSTYPE_H__ */
 diff -urN /usr/share/empty/fs/aufs/hbl.h linux/fs/aufs/hbl.h
 --- /usr/share/empty/fs/aufs/hbl.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/hbl.h	2026-10-19 08:28:44.916666486 +0200
++++ linux/fs/aufs/hbl.h	2026-11-24 08:11:35.572107588 +0100
 @@ -0,0 +1,52 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -16510,7 +16560,7 @@ diff -urN /usr/share/empty/fs/aufs/hbl.h linux/fs/aufs/hbl.h
 +#endif /* __AUFS_HBL_H__ */
 diff -urN /usr/share/empty/fs/aufs/hfsnotify.c linux/fs/aufs/hfsnotify.c
 --- /usr/share/empty/fs/aufs/hfsnotify.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/hfsnotify.c	2026-10-19 08:28:44.916666486 +0200
++++ linux/fs/aufs/hfsnotify.c	2026-11-24 08:11:35.572224312 +0100
 @@ -0,0 +1,278 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -16792,7 +16842,7 @@ diff -urN /usr/share/empty/fs/aufs/hfsnotify.c linux/fs/aufs/hfsnotify.c
 +};
 diff -urN /usr/share/empty/fs/aufs/hfsplus.c linux/fs/aufs/hfsplus.c
 --- /usr/share/empty/fs/aufs/hfsplus.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/hfsplus.c	2026-10-19 08:28:44.916666486 +0200
++++ linux/fs/aufs/hfsplus.c	2026-11-24 08:11:35.572349562 +0100
 @@ -0,0 +1,47 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -16843,7 +16893,7 @@ diff -urN /usr/share/empty/fs/aufs/hfsplus.c linux/fs/aufs/hfsplus.c
 +}
 diff -urN /usr/share/empty/fs/aufs/hnotify.c linux/fs/aufs/hnotify.c
 --- /usr/share/empty/fs/aufs/hnotify.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/hnotify.c	2026-10-19 08:28:44.916666486 +0200
++++ linux/fs/aufs/hnotify.c	2026-11-24 08:11:35.572557282 +0100
 @@ -0,0 +1,702 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -17549,7 +17599,7 @@ diff -urN /usr/share/empty/fs/aufs/hnotify.c linux/fs/aufs/hnotify.c
 +}
 diff -urN /usr/share/empty/fs/aufs/iinfo.c linux/fs/aufs/iinfo.c
 --- /usr/share/empty/fs/aufs/iinfo.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/iinfo.c	2026-10-19 08:28:44.916666486 +0200
++++ linux/fs/aufs/iinfo.c	2026-11-24 08:11:35.573928691 +0100
 @@ -0,0 +1,275 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -17828,8 +17878,8 @@ diff -urN /usr/share/empty/fs/aufs/iinfo.c linux/fs/aufs/iinfo.c
 +}
 diff -urN /usr/share/empty/fs/aufs/inode.c linux/fs/aufs/inode.c
 --- /usr/share/empty/fs/aufs/inode.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/inode.c	2026-10-19 08:28:44.916666486 +0200
-@@ -0,0 +1,520 @@
++++ linux/fs/aufs/inode.c	2026-11-24 08:11:36.744067080 +0100
+@@ -0,0 +1,529 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -18189,7 +18239,8 @@ diff -urN /usr/share/empty/fs/aufs/inode.c linux/fs/aufs/inode.c
 +
 +/* successful returns with iinfo write_locked */
 +/* todo: return with unlocked? */
-+struct inode *au_new_inode(struct dentry *dentry, int must_new)
++/* returns the inode iinfo write-locked, or an error */
++static struct inode *au_do_new_inode(struct dentry *dentry, int must_new)
 +{
 +	struct inode *inode, *h_inode;
 +	struct dentry *h_dentry;
@@ -18306,6 +18357,14 @@ diff -urN /usr/share/empty/fs/aufs/inode.c linux/fs/aufs/inode.c
 +	return inode;
 +}
 +
++int au_new_inode(struct dentry *dentry, int must_new, struct inode **inode)
++{
++	*inode = au_do_new_inode(dentry, must_new);
++	if (IS_ERR(*inode))
++		return PTR_ERR(*inode);
++	return 0;
++}
++
 +/* ---------------------------------------------------------------------- */
 +
 +int au_test_ro(struct super_block *sb, aufs_bindex_t bindex,
@@ -18352,8 +18411,8 @@ diff -urN /usr/share/empty/fs/aufs/inode.c linux/fs/aufs/inode.c
 +}
 diff -urN /usr/share/empty/fs/aufs/inode.h linux/fs/aufs/inode.h
 --- /usr/share/empty/fs/aufs/inode.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/inode.h	2026-10-19 08:28:44.916666486 +0200
-@@ -0,0 +1,716 @@
++++ linux/fs/aufs/inode.h	2026-11-24 08:11:36.744312505 +0100
+@@ -0,0 +1,721 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -18499,7 +18558,8 @@ diff -urN /usr/share/empty/fs/aufs/inode.h linux/fs/aufs/inode.h
 +int au_refresh_hinode(struct inode *inode, struct dentry *dentry);
 +int au_ino(struct super_block *sb, aufs_bindex_t bindex, ino_t h_ino,
 +	   unsigned int d_type, ino_t *ino);
-+struct inode *au_new_inode(struct dentry *dentry, int must_new);
++/* returns 0 with the iinfo of the new *inode write-locked */
++int au_new_inode(struct dentry *dentry, int must_new, struct inode **inode);
 +int au_test_ro(struct super_block *sb, aufs_bindex_t bindex,
 +	       struct inode *inode);
 +int au_test_h_perm(struct mnt_idmap *h_idmap, struct inode *h_inode,
@@ -18574,8 +18634,12 @@ diff -urN /usr/share/empty/fs/aufs/inode.h linux/fs/aufs/inode.h
 +int au_pin_and_icpup(struct dentry *dentry, struct iattr *ia,
 +		     struct au_icpup_args *a);
 +
++/* returns 0 with the dinfo read-locked, or an error with nothing locked */
 +int au_h_path_getattr(struct dentry *dentry, struct inode *inode, int force,
-+		      struct path *h_path, int locked);
++		      struct path *h_path);
++/* the caller already holds the dinfo lock */
++int au_h_path_getattr_locked(struct dentry *dentry, struct inode *inode,
++			     int force, struct path *h_path);
 +
 +/* i_op_add.c */
 +int au_may_add(struct dentry *dentry, aufs_bindex_t bindex,
@@ -19072,7 +19136,7 @@ diff -urN /usr/share/empty/fs/aufs/inode.h linux/fs/aufs/inode.h
 +#endif /* __AUFS_INODE_H__ */
 diff -urN /usr/share/empty/fs/aufs/ioctl.c linux/fs/aufs/ioctl.c
 --- /usr/share/empty/fs/aufs/ioctl.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/ioctl.c	2026-10-19 08:28:44.916666486 +0200
++++ linux/fs/aufs/ioctl.c	2026-11-24 08:11:35.574454657 +0100
 @@ -0,0 +1,207 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -19283,8 +19347,8 @@ diff -urN /usr/share/empty/fs/aufs/ioctl.c linux/fs/aufs/ioctl.c
 +#endif
 diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 --- /usr/share/empty/fs/aufs/i_op_add.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/i_op_add.c	2026-10-19 08:28:44.916666486 +0200
-@@ -0,0 +1,939 @@
++++ linux/fs/aufs/i_op_add.c	2026-11-24 08:11:36.743538663 +0100
+@@ -0,0 +1,959 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -19328,8 +19392,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +			goto out;
 +	}
 +
-+	inode = au_new_inode(dentry, /*must_new*/1);
-+	if (!IS_ERR(inode)) {
++	err = au_new_inode(dentry, /*must_new*/1, &inode);
++	if (!err) {
 +		d_instantiate(dentry, inode);
 +		dir = d_inode(dentry->d_parent); /* dir inode is locked */
 +		IMustLock(dir);
@@ -19339,7 +19403,6 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +		return 0; /* success */
 +	}
 +
-+	err = PTR_ERR(inode);
 +	if (!wh_dentry)
 +		goto out;
 +
@@ -19513,8 +19576,17 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +	} u;
 +};
 +
-+static int add_simple(struct inode *dir, struct dentry *dentry,
-+		      struct simple_arg *arg)
++/* to reduce stack size */
++struct au_add_simple_a {
++	struct au_dtime dt;
++	struct au_pin pin;
++	struct path h_path;
++	struct au_wr_dir_args wr_dir_args;
++};
++
++/* called with the dinfo of @dentry and its parent write-locked */
++static int au_do_add_simple(struct inode *dir, struct dentry *dentry,
++			    struct simple_arg *arg, struct au_add_simple_a *a)
 +{
 +	int err, rerr;
 +	aufs_bindex_t btop;
@@ -19522,44 +19594,16 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +	const unsigned char try_aopen
 +		= (arg->type == Creat && arg->u.c.try_aopen);
 +	struct vfsub_aopen_args *aopen = arg->u.c.aopen;
-+	struct dentry *wh_dentry, *parent;
++	struct dentry *wh_dentry;
 +	struct inode *h_dir;
 +	struct super_block *sb;
 +	struct au_branch *br;
-+	/* to reduce stack size */
-+	struct {
-+		struct au_dtime dt;
-+		struct au_pin pin;
-+		struct path h_path;
-+		struct au_wr_dir_args wr_dir_args;
-+	} *a;
-+
-+	AuDbg("%pd\n", dentry);
-+	IMustLock(dir);
 +
-+	err = -ENOMEM;
-+	a = kmalloc_obj(*a, GFP_NOFS);
-+	if (unlikely(!a))
-+		goto out;
-+	a->wr_dir_args.force_btgt = -1;
-+	a->wr_dir_args.flags = AuWrDir_ADD_ENTRY;
-+
-+	parent = dentry->d_parent; /* dir inode is locked */
-+	if (!try_aopen) {
-+		err = aufs_read_lock(dentry, AuLock_DW | AuLock_GEN);
-+		if (unlikely(err))
-+			goto out_free;
-+	}
-+	err = au_d_may_add(dentry);
-+	if (unlikely(err))
-+		goto out_unlock;
-+	if (!try_aopen)
-+		di_write_lock_parent(parent);
 +	wh_dentry = lock_hdir_lkup_wh(dentry, &a->dt, /*src_dentry*/NULL,
 +				      &a->pin, &a->wr_dir_args);
 +	err = PTR_ERR(wh_dentry);
 +	if (IS_ERR(wh_dentry))
-+		goto out_parent;
++		goto out;
 +
 +	btop = au_dbtop(dentry);
 +	sb = dentry->d_sb;
@@ -19620,16 +19664,57 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +out_unpin:
 +	au_unpin(&a->pin);
 +	dput(wh_dentry);
-+out_parent:
-+	if (!try_aopen)
++out:
++	return err;
++}
++
++static int add_simple(struct inode *dir, struct dentry *dentry,
++		      struct simple_arg *arg)
++{
++	int err;
++	const unsigned char try_aopen
++		= (arg->type == Creat && arg->u.c.try_aopen);
++	struct dentry *parent;
++	struct au_add_simple_a *a;
++
++	AuDbg("%pd\n", dentry);
++	IMustLock(dir);
++
++	err = -ENOMEM;
++	a = kmalloc_obj(*a, GFP_NOFS);
++	if (unlikely(!a))
++		goto out;
++	a->wr_dir_args.force_btgt = -1;
++	a->wr_dir_args.flags = AuWrDir_ADD_ENTRY;
++
++	parent = dentry->d_parent; /* dir inode is locked */
++	if (try_aopen) {
++		/* aufs_atomic_open() holds the dinfo locks */
++		err = au_d_may_add(dentry);
++		if (!err)
++			err = au_do_add_simple(dir, dentry, arg, a);
++		if (unlikely(err)) {
++			au_update_dbtop(dentry);
++			d_drop(dentry);
++		}
++		goto out_free;
++	}
++
++	err = aufs_read_lock(dentry, AuLock_DW | AuLock_GEN);
++	if (unlikely(err))
++		goto out_free;
++	err = au_d_may_add(dentry);
++	if (!err) {
++		di_write_lock_parent(parent);
++		err = au_do_add_simple(dir, dentry, arg, a);
 +		di_write_unlock(parent);
-+out_unlock:
++	}
 +	if (unlikely(err)) {
 +		au_update_dbtop(dentry);
 +		d_drop(dentry);
 +	}
-+	if (!try_aopen)
-+		aufs_read_unlock(dentry, AuLock_DW);
++	aufs_read_unlock(dentry, AuLock_DW);
++
 +out_free:
 +	au_kfree_rcu(a);
 +out:
@@ -19764,9 +19849,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +	au_set_dbtop(dentry, bindex);
 +	au_set_dbbot(dentry, bindex);
 +	au_set_h_dptr(dentry, bindex, dget(h_dentry));
-+	inode = au_new_inode(dentry, /*must_new*/1);
-+	if (IS_ERR(inode)) {
-+		err = PTR_ERR(inode);
++	err = au_new_inode(dentry, /*must_new*/1, &inode);
++	if (unlikely(err)) {
 +		au_set_h_dptr(dentry, bindex, NULL);
 +		au_set_dbtop(dentry, -1);
 +		au_set_dbbot(dentry, -1);
@@ -20226,8 +20310,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op_add.c linux/fs/aufs/i_op_add.c
 +}
 diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 --- /usr/share/empty/fs/aufs/i_op.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/i_op.c	2026-10-19 08:28:44.916666486 +0200
-@@ -0,0 +1,1504 @@
++++ linux/fs/aufs/i_op.c	2026-11-24 08:11:36.743278536 +0100
+@@ -0,0 +1,1577 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -20377,6 +20461,24 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +
 +/* ---------------------------------------------------------------------- */
 +
++/*
++ * after d_splice_alias(@inode, @dentry) returned @ret.  If @dentry got
++ * @inode, the iinfo lock is released later by di_write_unlock(@dentry),
++ * otherwise here.
++ */
++static void au_lookup_post(struct dentry *dentry, struct inode *inode,
++			   struct dentry *ret)
++{
++	if (!IS_ERR(ret)) {
++		iput(inode);
++		if (ret && ret != dentry)
++			ii_write_unlock(inode);
++	} else {
++		ii_write_unlock(inode);
++		iput(inode);
++	}
++}
++
 +static struct dentry *aufs_lookup(struct inode *dir, struct dentry *dentry,
 +				  unsigned int flags)
 +{
@@ -20407,7 +20509,6 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +	if (unlikely(err))
 +		goto out_si;
 +
-+	inode = NULL;
 +	npositive = 0; /* suppress a warning */
 +	parent = dentry->d_parent; /* dir inode is locked */
 +	di_read_lock_parent(parent, AuLock_IR);
@@ -20426,35 +20527,16 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +		goto out_unlock;
 +
 +	if (npositive) {
-+		inode = au_new_inode(dentry, /*must_new*/0);
-+		if (IS_ERR(inode)) {
-+			ret = (void *)inode;
-+			inode = NULL;
++		err = au_new_inode(dentry, /*must_new*/0, &inode);
++		if (unlikely(err)) {
++			ret = ERR_PTR(err);
 +			goto out_unlock;
 +		}
-+	}
-+
-+	if (inode)
 +		atomic_inc(&inode->i_count);
-+	ret = d_splice_alias(inode, dentry);
-+#if 0 /* reserved for future use */
-+	if (unlikely(d_need_lookup(dentry))) {
-+		spin_lock(&dentry->d_lock);
-+		dentry->d_flags &= ~DCACHE_NEED_LOOKUP;
-+		spin_unlock(&dentry->d_lock);
++		ret = d_splice_alias(inode, dentry);
++		au_lookup_post(dentry, inode, ret);
 +	} else
-+#endif
-+	if (inode) {
-+		if (!IS_ERR(ret)) {
-+			iput(inode);
-+			if (ret && ret != dentry)
-+				ii_write_unlock(inode);
-+		} else {
-+			ii_write_unlock(inode);
-+			iput(inode);
-+			inode = NULL;
-+		}
-+	}
++		ret = d_splice_alias(NULL, dentry);
 +
 +out_unlock:
 +	di_write_unlock(dentry);
@@ -20667,19 +20749,15 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +
 +/* ---------------------------------------------------------------------- */
 +
-+static int au_wr_dir_cpup(struct dentry *dentry, struct dentry *parent,
-+			  const unsigned char add_entry, aufs_bindex_t bcpup,
-+			  aufs_bindex_t btop)
++/* the caller holds the dinfo lock of @parent */
++static int au_do_wr_dir_cpup(struct dentry *dentry, struct dentry *parent,
++			     const unsigned char add_entry,
++			     aufs_bindex_t bcpup, aufs_bindex_t btop)
 +{
 +	int err;
 +	struct dentry *h_parent;
 +	struct inode *h_dir;
 +
-+	if (add_entry)
-+		IMustLock(d_inode(parent));
-+	else
-+		di_write_lock_parent(parent);
-+
 +	err = 0;
 +	if (!au_h_dptr(parent, bcpup)) {
 +		if (btop > bcpup)
@@ -20705,8 +20783,6 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +		}
 +	}
 +
-+	if (!add_entry)
-+		di_write_unlock(parent);
 +	if (!err)
 +		err = bcpup; /* success */
 +
@@ -20714,6 +20790,27 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +	return err;
 +}
 +
++static int au_wr_dir_cpup(struct dentry *dentry, struct dentry *parent,
++			  const unsigned char add_entry, aufs_bindex_t bcpup,
++			  aufs_bindex_t btop)
++{
++	int err;
++
++	if (add_entry) {
++		/* the dinfo of @parent is locked by the caller */
++		IMustLock(d_inode(parent));
++		err = au_do_wr_dir_cpup(dentry, parent, add_entry, bcpup,
++					btop);
++	} else {
++		di_write_lock_parent(parent);
++		err = au_do_wr_dir_cpup(dentry, parent, add_entry, bcpup,
++					btop);
++		di_write_unlock(parent);
++	}
++
++	return err;
++}
++
 +/*
 + * decide the branch and the parent dir where we will create a new entry.
 + * returns new bindex or an error.
@@ -20886,6 +20983,22 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +	return NULL;
 +}
 +
++/*
++ * Lock/unlock the parent dinfo unless the caller has locked it
++ * (AuPin_DI_LOCKED).
++ */
++static void au_pin_di_read_lock(struct au_pin *p)
++{
++	if (!au_ftest_pin(p->flags, DI_LOCKED))
++		di_read_lock(p->parent, AuLock_IR, p->lsc_di);
++}
++
++static void au_pin_di_read_unlock(struct au_pin *p)
++{
++	if (!au_ftest_pin(p->flags, DI_LOCKED))
++		di_read_unlock(p->parent, AuLock_IR);
++}
++
 +void au_unpin(struct au_pin *p)
 +{
 +	if (p->hdir)
@@ -20895,8 +21008,7 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +	if (!p->hdir)
 +		return;
 +
-+	if (!au_ftest_pin(p->flags, DI_LOCKED))
-+		di_read_unlock(p->parent, AuLock_IR);
++	au_pin_di_read_unlock(p);
 +	iput(p->hdir->hi_inode);
 +	dput(p->parent);
 +	p->parent = NULL;
@@ -20931,8 +21043,7 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +		p->h_dentry = au_h_dptr(p->dentry, p->bindex);
 +
 +	p->parent = dget_parent(p->dentry);
-+	if (!au_ftest_pin(p->flags, DI_LOCKED))
-+		di_read_lock(p->parent, AuLock_IR, p->lsc_di);
++	au_pin_di_read_lock(p);
 +
 +	h_dir = NULL;
 +	p->h_parent = au_h_dptr(p->parent, p->bindex);
@@ -20947,8 +21058,7 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +	 */
 +	if (unlikely(!p->hdir || !h_dir || !p->h_parent)) {
 +		err = -EBUSY;
-+		if (!au_ftest_pin(p->flags, DI_LOCKED))
-+			di_read_unlock(p->parent, AuLock_IR);
++		au_pin_di_read_unlock(p);
 +		dput(p->parent);
 +		p->parent = NULL;
 +		goto out_err;
@@ -20959,8 +21069,7 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +		err = vfsub_mnt_want_write(p->h_mnt);
 +		if (unlikely(err)) {
 +			au_fclr_pin(p->flags, MNT_WRITE);
-+			if (!au_ftest_pin(p->flags, DI_LOCKED))
-+				di_read_unlock(p->parent, AuLock_IR);
++			au_pin_di_read_unlock(p);
 +			dput(p->parent);
 +			p->parent = NULL;
 +			goto out_err;
@@ -21038,6 +21147,40 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +	return err;
 +}
 +
++/*
++ * The parent dinfo is write-locked by au_icpup_lock_parent() unless the
++ * dentry is the root, i.e. it is held iff the returned parent is non-NULL.
++ * au_icpup_pass_parent() downgrades it and hands it over to the pin, which
++ * then releases it in au_unpin().
++ */
++static struct dentry *au_icpup_lock_parent(struct dentry *dentry)
++{
++	struct dentry *parent;
++
++	if (IS_ROOT(dentry))
++		return NULL;
++	parent = dget_parent(dentry);
++	di_write_lock_parent(parent);
++	return parent;
++}
++
++static void au_icpup_unlock_parent(struct dentry *parent)
++{
++	if (parent) {
++		di_write_unlock(parent);
++		dput(parent);
++	}
++}
++
++static void au_icpup_pass_parent(struct au_pin *pin, struct dentry *parent)
++{
++	if (parent) {
++		au_pin_set_parent_lflag(pin, /*lflag*/0);
++		di_downgrade_lock(parent, AuLock_IR);
++		dput(parent);
++	}
++}
++
 +int au_pin_and_icpup(struct dentry *dentry, struct iattr *ia,
 +		     struct au_icpup_args *a)
 +{
@@ -21068,12 +21211,9 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +
 +	err = 0;
 +	a->pin_flags = AuPin_MNT_WRITE;
-+	parent = NULL;
-+	if (!IS_ROOT(dentry)) {
++	parent = au_icpup_lock_parent(dentry);
++	if (parent)
 +		au_fset_pin(a->pin_flags, DI_LOCKED);
-+		parent = dget_parent(dentry);
-+		di_write_lock_parent(parent);
-+	}
 +
 +	err = au_pin(&a->pin, dentry, a->btgt, a->udba, a->pin_flags);
 +	if (unlikely(err))
@@ -21108,12 +21248,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +		}
 +	}
 +
-+	if (parent) {
-+		au_pin_set_parent_lflag(&a->pin, /*lflag*/0);
-+		di_downgrade_lock(parent, AuLock_IR);
-+		dput(parent);
-+		parent = NULL;
-+	}
++	au_icpup_pass_parent(&a->pin, parent);
++	parent = NULL;
 +	if (!au_ftest_icpup(a->flags, DID_CPUP))
 +		goto out; /* success */
 +
@@ -21140,81 +21276,34 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +		goto out; /* success */
 +	au_unpin(&a->pin);
 +out_parent:
-+	if (parent) {
-+		di_write_unlock(parent);
-+		dput(parent);
-+	}
++	au_icpup_unlock_parent(parent);
 +out:
 +	if (!err)
 +		inode_lock_nested(a->h_inode, AuLsc_I_CHILD);
 +	return err;
 +}
 +
-+static int aufs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
-+			struct iattr *ia)
++/*
++ * called with the dinfo of @dentry write-locked, and the finfo too for
++ * ATTR_FILE
++ */
++static int au_do_setattr(struct dentry *dentry, struct iattr *ia,
++			 struct au_icpup_args *a)
 +{
 +	int err;
 +	struct inode *inode;
-+	struct super_block *sb;
-+	struct file *file;
-+	struct au_icpup_args *a;
 +	struct mnt_idmap *h_idmap;
 +
 +	inode = d_inode(dentry);
-+	IMustLock(inode);
-+
-+	err = setattr_prepare(idmap, dentry, ia);
-+	if (unlikely(err))
-+		goto out;
-+
-+	err = -ENOMEM;
-+	a = kzalloc_obj(*a, GFP_NOFS);
-+	if (unlikely(!a))
-+		goto out;
-+
-+	if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID))
-+		ia->ia_valid &= ~ATTR_MODE;
-+
-+	file = NULL;
-+	sb = dentry->d_sb;
-+	err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM);
-+	if (unlikely(err))
-+		goto out_kfree;
-+
-+	if (ia->ia_valid & ATTR_FILE) {
-+		/* currently ftruncate(2) only */
-+		AuDebugOn(!d_is_reg(dentry));
-+		file = ia->ia_file;
-+		err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1,
-+					    /*fi_lsc*/0);
-+		if (unlikely(err))
-+			goto out_si;
-+		ia->ia_file = au_hf_top(file);
-+		a->udba = AuOpt_UDBA_NONE;
-+	} else {
-+		/* fchmod() doesn't pass ia_file */
-+		a->udba = au_opt_udba(sb);
-+		di_write_lock_child(dentry);
-+		/* no d_unlinked(), to set UDBA_NONE for root */
-+		if (d_unhashed(dentry))
-+			a->udba = AuOpt_UDBA_NONE;
-+		if (a->udba != AuOpt_UDBA_NONE) {
-+			AuDebugOn(IS_ROOT(dentry));
-+			err = au_reval_for_attr(dentry, au_sigen(sb));
-+			if (unlikely(err))
-+				goto out_dentry;
-+		}
-+	}
-+
 +	err = au_pin_and_icpup(dentry, ia, a);
 +	if (unlikely(err < 0))
-+		goto out_dentry;
++		goto out;
 +	if (au_ftest_icpup(a->flags, DID_CPUP)) {
 +		ia->ia_file = NULL;
 +		ia->ia_valid &= ~ATTR_FILE;
 +	}
 +
-+	a->h_path.mnt = au_sbr_mnt(sb, a->btgt);
++	a->h_path.mnt = au_sbr_mnt(dentry->d_sb, a->btgt);
 +	err = vfsub_mnt_want_write(a->h_path.mnt);
 +	if (unlikely(err))
 +		goto out_unlock;
@@ -21264,13 +21353,71 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +	au_unpin(&a->pin);
 +	if (unlikely(err))
 +		au_update_dbtop(dentry);
-+out_dentry:
-+	di_write_unlock(dentry);
-+	if (file) {
++out:
++	return err;
++}
++
++static int aufs_setattr(struct mnt_idmap *idmap, struct dentry *dentry,
++			struct iattr *ia)
++{
++	int err;
++	struct inode *inode;
++	struct super_block *sb;
++	struct file *file;
++	struct au_icpup_args *a;
++
++	inode = d_inode(dentry);
++	IMustLock(inode);
++
++	err = setattr_prepare(idmap, dentry, ia);
++	if (unlikely(err))
++		goto out;
++
++	err = -ENOMEM;
++	a = kzalloc_obj(*a, GFP_NOFS);
++	if (unlikely(!a))
++		goto out;
++
++	if (ia->ia_valid & (ATTR_KILL_SUID | ATTR_KILL_SGID))
++		ia->ia_valid &= ~ATTR_MODE;
++
++	sb = dentry->d_sb;
++	err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM);
++	if (unlikely(err))
++		goto out_kfree;
++
++	if (ia->ia_valid & ATTR_FILE) {
++		/* currently ftruncate(2) only */
++		AuDebugOn(!d_is_reg(dentry));
++		file = ia->ia_file;
++		AuDebugOn(file->f_path.dentry != dentry);
++		err = au_reval_and_lock_fdi(file, au_reopen_nondir, /*wlock*/1,
++					    /*fi_lsc*/0);
++		if (unlikely(err))
++			goto out_si;
++		ia->ia_file = au_hf_top(file);
++		a->udba = AuOpt_UDBA_NONE;
++		err = au_do_setattr(dentry, ia, a);
++		di_write_unlock(file->f_path.dentry);
 +		fi_write_unlock(file);
 +		ia->ia_file = file;
 +		ia->ia_valid |= ATTR_FILE;
++	} else {
++		/* fchmod() doesn't pass ia_file */
++		a->udba = au_opt_udba(sb);
++		di_write_lock_child(dentry);
++		/* no d_unlinked(), to set UDBA_NONE for root */
++		if (d_unhashed(dentry))
++			a->udba = AuOpt_UDBA_NONE;
++		if (a->udba != AuOpt_UDBA_NONE) {
++			AuDebugOn(IS_ROOT(dentry));
++			err = au_reval_for_attr(dentry, au_sigen(sb));
++		}
++		if (!err)
++			err = au_do_setattr(dentry, ia, a);
++		di_write_unlock(dentry);
 +	}
++
 +out_si:
 +	si_read_unlock(sb);
 +out_kfree:
@@ -21408,28 +21555,62 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 + * returns zero or negative (an error).
 + * @dentry will be read-locked in success.
 + */
-+int au_h_path_getattr(struct dentry *dentry, struct inode *inode, int force,
-+		      struct path *h_path, int locked)
++int au_h_path_getattr_locked(struct dentry *dentry, struct inode *inode,
++			     int force, struct path *h_path)
 +{
-+	int err;
-+	unsigned int mnt_flags, sigen;
-+	unsigned char udba_none;
++	unsigned int mnt_flags;
 +	aufs_bindex_t bindex;
 +	struct super_block *sb, *h_sb;
 +
 +	h_path->mnt = NULL;
 +	h_path->dentry = NULL;
 +
-+	err = 0;
 +	sb = dentry->d_sb;
 +	mnt_flags = au_mntflags(sb);
-+	udba_none = !!au_opt_test(mnt_flags, UDBA_NONE);
 +
-+	if (unlikely(locked))
-+		goto body; /* skip locking dinfo */
++	if (!inode) {
++		inode = d_inode(dentry);
++		if (unlikely(!inode))
++			goto out;
++	}
++	bindex = au_ibtop(inode);
++	h_path->mnt = au_sbr_mnt(sb, bindex);
++	h_sb = h_path->mnt->mnt_sb;
++	if (!force
++	    && !au_test_fs_bad_iattr(h_sb)
++	    && au_opt_test(mnt_flags, UDBA_NONE))
++		goto out; /* success */
++
++	if (au_dbtop(dentry) == bindex)
++		h_path->dentry = au_h_dptr(dentry, bindex);
++	else if (au_opt_test(mnt_flags, PLINK) && au_plink_test(inode)) {
++		h_path->dentry = au_plink_lkup(inode, bindex);
++		if (IS_ERR(h_path->dentry))
++			/* pretending success */
++			h_path->dentry = NULL;
++		else
++			dput(h_path->dentry);
++	}
++
++out:
++	return 0;
++}
++
++int au_h_path_getattr(struct dentry *dentry, struct inode *inode, int force,
++		      struct path *h_path)
++{
++	int err;
++	unsigned int sigen;
++	struct super_block *sb;
++
++	h_path->mnt = NULL;
++	h_path->dentry = NULL;
++
++	err = 0;
++	sb = dentry->d_sb;
 +
 +	/* support fstat(2) */
-+	if (!d_unlinked(dentry) && !udba_none) {
++	if (!d_unlinked(dentry) && !au_opt_test(au_mntflags(sb), UDBA_NONE)) {
 +		sigen = au_sigen(sb);
 +		err = au_digen_test(dentry, sigen);
 +		if (!err) {
@@ -21455,30 +21636,7 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +	} else
 +		di_read_lock_child(dentry, AuLock_IR);
 +
-+body:
-+	if (!inode) {
-+		inode = d_inode(dentry);
-+		if (unlikely(!inode))
-+			goto out;
-+	}
-+	bindex = au_ibtop(inode);
-+	h_path->mnt = au_sbr_mnt(sb, bindex);
-+	h_sb = h_path->mnt->mnt_sb;
-+	if (!force
-+	    && !au_test_fs_bad_iattr(h_sb)
-+	    && udba_none)
-+		goto out; /* success */
-+
-+	if (au_dbtop(dentry) == bindex)
-+		h_path->dentry = au_h_dptr(dentry, bindex);
-+	else if (au_opt_test(mnt_flags, PLINK) && au_plink_test(inode)) {
-+		h_path->dentry = au_plink_lkup(inode, bindex);
-+		if (IS_ERR(h_path->dentry))
-+			/* pretending success */
-+			h_path->dentry = NULL;
-+		else
-+			dput(h_path->dentry);
-+	}
++	err = au_h_path_getattr_locked(dentry, inode, force, h_path);
 +
 +out:
 +	return err;
@@ -21500,8 +21658,7 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +	err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM);
 +	if (unlikely(err))
 +		goto out;
-+	err = au_h_path_getattr(dentry, /*inode*/NULL, /*force*/0, &h_path,
-+				/*locked*/0);
++	err = au_h_path_getattr(dentry, /*inode*/NULL, /*force*/0, &h_path);
 +	if (unlikely(err))
 +		goto out_si;
 +	if (unlikely(!h_path.dentry))
@@ -21734,7 +21891,7 @@ diff -urN /usr/share/empty/fs/aufs/i_op.c linux/fs/aufs/i_op.c
 +};
 diff -urN /usr/share/empty/fs/aufs/i_op_del.c linux/fs/aufs/i_op_del.c
 --- /usr/share/empty/fs/aufs/i_op_del.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/i_op_del.c	2026-10-19 08:28:44.916666486 +0200
++++ linux/fs/aufs/i_op_del.c	2026-11-24 08:11:35.573296870 +0100
 @@ -0,0 +1,504 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -22242,8 +22399,8 @@ diff -urN /usr/share/empty/fs/aufs/i_op_del.c linux/fs/aufs/i_op_del.c
 +}
 diff -urN /usr/share/empty/fs/aufs/i_op_ren.c linux/fs/aufs/i_op_ren.c
 --- /usr/share/empty/fs/aufs/i_op_ren.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/i_op_ren.c	2026-10-19 08:28:44.916666486 +0200
-@@ -0,0 +1,1229 @@
++++ linux/fs/aufs/i_op_ren.c	2026-11-24 08:11:36.743859675 +0100
+@@ -0,0 +1,1254 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -23177,6 +23334,47 @@ diff -urN /usr/share/empty/fs/aufs/i_op_ren.c linux/fs/aufs/i_op_ren.c
 +
 +/* ---------------------------------------------------------------------- */
 +
++/*
++ * The dst parent dinfo is write-locked through the rename, and the src
++ * parent too when they differ (ISSAMEDIR is cleared).
++ */
++
++/*
++ * called with the dst parent write-locked, returns with both parents
++ * write-locked.
++ */
++static int au_ren_need_wh_diffdir(struct au_ren_args *a)
++{
++	int err;
++
++	/*
++	 * this temporary unlock is safe,
++	 * because both dir->i_mutex are locked.
++	 */
++	di_write_unlock(a->dst_parent);
++	AuDebugOn(a->src_parent == a->dst_dentry);
++	AuDebugOn(d_inode(a->src_parent) == d_inode(a->dst_dentry));
++	AuDebugOn(a->src_parent == a->src_dentry);
++	AuDebugOn(d_inode(a->src_parent) == d_inode(a->src_dentry));
++	di_write_lock_parent(a->src_parent);
++	err = au_wr_dir_need_wh(a->src_dentry,
++				au_ftest_ren(a->auren_flags, ISDIR_SRC),
++				&a->btgt);
++	di_write_unlock(a->src_parent);
++	di_write_lock2_parent(a->src_parent, a->dst_parent, /*isdir*/1);
++	au_fclr_ren(a->auren_flags, ISSAMEDIR);
++
++	return err;
++}
++
++static void au_ren_unlock_parents(struct au_ren_args *a)
++{
++	if (au_ftest_ren(a->auren_flags, ISSAMEDIR))
++		di_write_unlock(a->dst_parent);
++	else
++		di_write_unlock2(a->src_parent, a->dst_parent);
++}
++
 +int aufs_rename(struct mnt_idmap *idmap,
 +		struct inode *_src_dir, struct dentry *_src_dentry,
 +		struct inode *_dst_dir, struct dentry *_dst_dentry,
@@ -23305,22 +23503,9 @@ diff -urN /usr/share/empty/fs/aufs/i_op_ren.c linux/fs/aufs/i_op_ren.c
 +
 +	err = 0;
 +	if (!a->exchange) {
-+		if (a->src_dir != a->dst_dir) {
-+			/*
-+			 * this temporary unlock is safe,
-+			 * because both dir->i_mutex are locked.
-+			 */
-+			di_write_unlock(a->dst_parent);
-+			di_write_lock_parent(a->src_parent);
-+			err = au_wr_dir_need_wh(a->src_dentry,
-+						au_ftest_ren(a->auren_flags,
-+							     ISDIR_SRC),
-+						&a->btgt);
-+			di_write_unlock(a->src_parent);
-+			di_write_lock2_parent(a->src_parent, a->dst_parent,
-+					      /*isdir*/1);
-+			au_fclr_ren(a->auren_flags, ISSAMEDIR);
-+		} else
++		if (a->src_dir != a->dst_dir)
++			err = au_ren_need_wh_diffdir(a);
++		else
 +			err = au_wr_dir_need_wh(a->src_dentry,
 +						au_ftest_ren(a->auren_flags,
 +							     ISDIR_SRC),
@@ -23458,10 +23643,7 @@ diff -urN /usr/share/empty/fs/aufs/i_op_ren.c linux/fs/aufs/i_op_ren.c
 +		if (!a->dst_inode)
 +			d_drop(a->dst_dentry);
 +	}
-+	if (au_ftest_ren(a->auren_flags, ISSAMEDIR))
-+		di_write_unlock(a->dst_parent);
-+	else
-+		di_write_unlock2(a->src_parent, a->dst_parent);
++	au_ren_unlock_parents(a);
 +out_unlock:
 +	aufs_read_and_write_unlock2(a->dst_dentry, a->src_dentry);
 +out_free:
@@ -23680,7 +23862,7 @@ diff -urN /usr/share/empty/fs/aufs/Kconfig linux/fs/aufs/Kconfig
 +endif
 diff -urN /usr/share/empty/fs/aufs/lcnt.h linux/fs/aufs/lcnt.h
 --- /usr/share/empty/fs/aufs/lcnt.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/lcnt.h	2026-10-19 08:28:44.916666486 +0200
++++ linux/fs/aufs/lcnt.h	2026-11-24 08:11:35.574550179 +0100
 @@ -0,0 +1,173 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -23857,7 +24039,7 @@ diff -urN /usr/share/empty/fs/aufs/lcnt.h linux/fs/aufs/lcnt.h
 +#endif /* __AUFS_LCNT_H__ */
 diff -urN /usr/share/empty/fs/aufs/loop.c linux/fs/aufs/loop.c
 --- /usr/share/empty/fs/aufs/loop.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/loop.c	2026-10-19 08:28:44.916666486 +0200
++++ linux/fs/aufs/loop.c	2026-11-24 08:11:35.574550179 +0100
 @@ -0,0 +1,144 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -24005,7 +24187,7 @@ diff -urN /usr/share/empty/fs/aufs/loop.c linux/fs/aufs/loop.c
 +}
 diff -urN /usr/share/empty/fs/aufs/loop.h linux/fs/aufs/loop.h
 --- /usr/share/empty/fs/aufs/loop.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/loop.h	2026-10-19 08:28:44.916666486 +0200
++++ linux/fs/aufs/loop.h	2026-11-24 08:11:35.574887874 +0100
 @@ -0,0 +1,42 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -24051,7 +24233,7 @@ diff -urN /usr/share/empty/fs/aufs/loop.h linux/fs/aufs/loop.h
 +#endif /* __AUFS_LOOP_H__ */
 diff -urN /usr/share/empty/fs/aufs/magic.mk linux/fs/aufs/magic.mk
 --- /usr/share/empty/fs/aufs/magic.mk	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/magic.mk	2026-10-19 08:28:44.916666486 +0200
++++ linux/fs/aufs/magic.mk	2026-11-24 08:11:35.574979284 +0100
 @@ -0,0 +1,25 @@
 +# SPDX-License-Identifier: GPL-2.0
 +
@@ -24080,7 +24262,7 @@ diff -urN /usr/share/empty/fs/aufs/magic.mk linux/fs/aufs/magic.mk
 +endif
 diff -urN /usr/share/empty/fs/aufs/Makefile linux/fs/aufs/Makefile
 --- /usr/share/empty/fs/aufs/Makefile	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/Makefile	2026-10-19 08:28:44.909999820 +0200
++++ linux/fs/aufs/Makefile	2026-11-24 08:11:35.565876139 +0100
 @@ -0,0 +1,49 @@
 +# SPDX-License-Identifier: GPL-2.0
 +
@@ -24133,7 +24315,7 @@ diff -urN /usr/share/empty/fs/aufs/Makefile linux/fs/aufs/Makefile
 +aufs-$(CONFIG_AUFS_MAGIC_SYSRQ) += sysrq.o
 diff -urN /usr/share/empty/fs/aufs/mf.c linux/fs/aufs/mf.c
 --- /usr/share/empty/fs/aufs/mf.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/mf.c	2026-10-19 08:28:44.916666486 +0200
++++ linux/fs/aufs/mf.c	2026-11-24 08:11:35.575082518 +0100
 @@ -0,0 +1,119 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -24256,7 +24438,7 @@ diff -urN /usr/share/empty/fs/aufs/mf.c linux/fs/aufs/mf.c
 +EXPORT_SYMBOL_GPL(au_do_file_user_inode);
 diff -urN /usr/share/empty/fs/aufs/module.c linux/fs/aufs/module.c
 --- /usr/share/empty/fs/aufs/module.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/module.c	2026-10-19 08:28:44.919999819 +0200
++++ linux/fs/aufs/module.c	2026-11-24 08:11:35.575258318 +0100
 @@ -0,0 +1,262 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -24522,7 +24704,7 @@ diff -urN /usr/share/empty/fs/aufs/module.c linux/fs/aufs/module.c
 +module_exit(aufs_exit);
 diff -urN /usr/share/empty/fs/aufs/module.h linux/fs/aufs/module.h
 --- /usr/share/empty/fs/aufs/module.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/module.h	2026-10-19 08:28:44.919999819 +0200
++++ linux/fs/aufs/module.h	2026-11-24 08:11:36.744312505 +0100
 @@ -0,0 +1,167 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -24579,11 +24761,11 @@ diff -urN /usr/share/empty/fs/aufs/module.h linux/fs/aufs/module.h
 +	kfree_rcu(a, rcu);
 +}
 +
-+#define au_kfree_rcu(_p) do {						\
-+		typeof(_p) p = (_p);					\
-+		BUILD_BUG_ON(sizeof(*p) < sizeof(struct rcu_head));	\
-+		if (p)							\
-+			au_kfree_do_rcu(p);				\
++#define au_kfree_rcu(__p) do {						\
++		typeof(__p) _p = (__p);					\
++		BUILD_BUG_ON(sizeof(*_p) < sizeof(struct rcu_head));	\
++		if (_p)							\
++			au_kfree_do_rcu(_p);				\
 +	} while (0)
 +
 +#define au_kfree_do_sz_test(sz)	(sz >= sizeof(struct rcu_head))
@@ -24693,8 +24875,8 @@ diff -urN /usr/share/empty/fs/aufs/module.h linux/fs/aufs/module.h
 +#endif /* __AUFS_MODULE_H__ */
 diff -urN /usr/share/empty/fs/aufs/mvdown.c linux/fs/aufs/mvdown.c
 --- /usr/share/empty/fs/aufs/mvdown.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/mvdown.c	2026-10-19 08:28:44.919999819 +0200
-@@ -0,0 +1,687 @@
++++ linux/fs/aufs/mvdown.c	2026-11-24 08:11:36.744607366 +0100
+@@ -0,0 +1,684 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2011-2026 Junjiro R. Okajima
@@ -25347,9 +25529,7 @@ diff -urN /usr/share/empty/fs/aufs/mvdown.c linux/fs/aufs/mvdown.c
 +	}
 +
 +	inode_lock_nested(inode, I_MUTEX_CHILD);
-+	err = aufs_read_lock(dentry, AuLock_DW | AuLock_FLUSH | AuLock_NOPLMW);
-+	if (unlikely(err))
-+		goto out_inode;
++	aufs_read_lock(dentry, AuLock_DW | AuLock_FLUSH | AuLock_NOPLMW);
 +
 +	di_write_lock_parent(args->parent);
 +	err = au_mvd_args(dmsg, args);
@@ -25369,7 +25549,6 @@ diff -urN /usr/share/empty/fs/aufs/mvdown.c linux/fs/aufs/mvdown.c
 +out_parent:
 +	di_write_unlock(args->parent);
 +	aufs_read_unlock(dentry, AuLock_DW);
-+out_inode:
 +	inode_unlock(inode);
 +out_dir:
 +	inode_unlock(args->dir);
@@ -25384,8 +25563,8 @@ diff -urN /usr/share/empty/fs/aufs/mvdown.c linux/fs/aufs/mvdown.c
 +}
 diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
 --- /usr/share/empty/fs/aufs/opts.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/opts.c	2026-10-19 08:28:44.919999819 +0200
-@@ -0,0 +1,1017 @@
++++ linux/fs/aufs/opts.c	2026-11-24 08:11:36.744832718 +0100
+@@ -0,0 +1,1032 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -26103,6 +26282,44 @@ diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
 +	return err;
 +}
 +
++/*
++ * whether the whiteout bases of @br need no (re-)initialization.
++ * called with br->br_wbr (if any) read-locked.
++ */
++static unsigned char au_opts_verify_skip(struct au_branch *br,
++					 unsigned char do_plink)
++{
++	unsigned char skip;
++	struct au_wbr *wbr = br->br_wbr;
++
++	if (!au_br_writable(br->br_perm)) {
++		skip = (!wbr
++			|| (!wbr->wbr_whbase
++			    && !wbr->wbr_plink
++			    && !wbr->wbr_orph));
++	} else if (!au_br_wh_linkable(br->br_perm)) {
++		/* skip = (!br->br_whbase && !br->br_orph); */
++		skip = (!wbr || !wbr->wbr_whbase);
++		if (skip && wbr) {
++			if (do_plink)
++				skip = !!wbr->wbr_plink;
++			else
++				skip = !wbr->wbr_plink;
++		}
++	} else {
++		/* skip = (br->br_whbase && br->br_ohph); */
++		skip = (wbr && wbr->wbr_whbase);
++		if (skip) {
++			if (do_plink)
++				skip = !!wbr->wbr_plink;
++			else
++				skip = !wbr->wbr_plink;
++		}
++	}
++
++	return skip;
++}
++
 +int au_opts_verify(struct super_block *sb, unsigned long sb_flags,
 +		   unsigned int pending)
 +{
@@ -26158,38 +26375,14 @@ diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
 +			br->br_perm &= ~AuBrAttr_ICEX_SEC;
 +#endif
 +
-+		do_free = 0;
 +		wbr = br->br_wbr;
-+		if (wbr)
++		do_free = !au_br_writable(br->br_perm) && wbr;
++		if (wbr) {
 +			wbr_wh_read_lock(wbr);
-+
-+		if (!au_br_writable(br->br_perm)) {
-+			do_free = !!wbr;
-+			skip = (!wbr
-+				|| (!wbr->wbr_whbase
-+				    && !wbr->wbr_plink
-+				    && !wbr->wbr_orph));
-+		} else if (!au_br_wh_linkable(br->br_perm)) {
-+			/* skip = (!br->br_whbase && !br->br_orph); */
-+			skip = (!wbr || !wbr->wbr_whbase);
-+			if (skip && wbr) {
-+				if (do_plink)
-+					skip = !!wbr->wbr_plink;
-+				else
-+					skip = !wbr->wbr_plink;
-+			}
-+		} else {
-+			/* skip = (br->br_whbase && br->br_ohph); */
-+			skip = (wbr && wbr->wbr_whbase);
-+			if (skip) {
-+				if (do_plink)
-+					skip = !!wbr->wbr_plink;
-+				else
-+					skip = !wbr->wbr_plink;
-+			}
-+		}
-+		if (wbr)
++			skip = au_opts_verify_skip(br, do_plink);
 +			wbr_wh_read_unlock(wbr);
++		} else
++			skip = au_opts_verify_skip(br, do_plink);
 +
 +		if (can_no_dreval) {
 +			dentry = br->br_path.dentry;
@@ -26210,11 +26403,12 @@ diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
 +
 +		hdir = au_hi(dir, bindex);
 +		au_hn_inode_lock_nested(hdir, AuLsc_I_PARENT);
-+		if (wbr)
++		if (wbr) {
 +			wbr_wh_write_lock(wbr);
-+		err = au_wh_init(br, sb);
-+		if (wbr)
++			err = au_wh_init(br, sb);
 +			wbr_wh_write_unlock(wbr);
++		} else
++			err = au_wh_init(br, sb);
 +		au_hn_inode_unlock(hdir);
 +
 +		if (!err && do_free) {
@@ -26405,7 +26599,7 @@ diff -urN /usr/share/empty/fs/aufs/opts.c linux/fs/aufs/opts.c
 +}
 diff -urN /usr/share/empty/fs/aufs/opts.h linux/fs/aufs/opts.h
 --- /usr/share/empty/fs/aufs/opts.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/opts.h	2026-10-19 08:28:44.919999819 +0200
++++ linux/fs/aufs/opts.h	2026-11-24 08:11:35.576636022 +0100
 @@ -0,0 +1,251 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -26660,8 +26854,8 @@ diff -urN /usr/share/empty/fs/aufs/opts.h linux/fs/aufs/opts.h
 +#endif /* __AUFS_OPTS_H__ */
 diff -urN /usr/share/empty/fs/aufs/plink.c linux/fs/aufs/plink.c
 --- /usr/share/empty/fs/aufs/plink.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/plink.c	2026-10-19 08:28:44.919999819 +0200
-@@ -0,0 +1,495 @@
++++ linux/fs/aufs/plink.c	2026-11-24 08:11:36.744994248 +0100
+@@ -0,0 +1,488 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -26729,19 +26923,12 @@ diff -urN /usr/share/empty/fs/aufs/plink.c linux/fs/aufs/plink.c
 +	}
 +	rcu_read_unlock();
 +
-+	if (au_ftest_lock(flags, NOPLMW)) {
-+		/* if there is no i_mutex lock in VFS, we don't need to wait */
-+		/* AuDebugOn(!lockdep_depth(current)); */
-+		while (sbi->si_plink_maint_pid) {
-+			si_read_unlock(sb);
-+			/* gave up wake_up_bit() */
-+			wait_event(sbi->si_plink_wq, !sbi->si_plink_maint_pid);
-+
-+			if (au_ftest_lock(flags, FLUSH))
-+				au_nwt_flush(&sbi->si_nowait);
-+			si_noflush_read_lock(sb);
-+		}
-+	} else if (au_ftest_lock(flags, NOPLM)) {
++	/*
++	 * Another process is maintaining the pseudo-links.  Only report it;
++	 * waiting (AuLock_NOPLMW) is done by si_{read,write}_lock(), which
++	 * know whether si_rwsem is held shared or exclusive.
++	 */
++	if (au_ftest_lock(flags, NOPLMW) || au_ftest_lock(flags, NOPLM)) {
 +		AuDbg("ppid %d, pid %d\n", ppid, pid);
 +		err = -EAGAIN;
 +	}
@@ -27159,7 +27346,7 @@ diff -urN /usr/share/empty/fs/aufs/plink.c linux/fs/aufs/plink.c
 +}
 diff -urN /usr/share/empty/fs/aufs/poll.c linux/fs/aufs/poll.c
 --- /usr/share/empty/fs/aufs/poll.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/poll.c	2026-10-19 08:28:44.919999819 +0200
++++ linux/fs/aufs/poll.c	2026-11-24 08:11:36.744994248 +0100
 @@ -0,0 +1,38 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -27184,7 +27371,7 @@ diff -urN /usr/share/empty/fs/aufs/poll.c linux/fs/aufs/poll.c
 +	sb = file->f_path.dentry->d_sb;
 +	si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLMW);
 +
-+	h_file = au_read_pre(file, /*keep_fi*/0, /*lsc*/0);
++	h_file = au_read_pre(file, /*lsc*/0);
 +	if (IS_ERR(h_file)) {
 +		AuDbg("h_file %ld\n", PTR_ERR(h_file));
 +		goto out;
@@ -27201,7 +27388,7 @@ diff -urN /usr/share/empty/fs/aufs/poll.c linux/fs/aufs/poll.c
 +}
 diff -urN /usr/share/empty/fs/aufs/posix_acl.c linux/fs/aufs/posix_acl.c
 --- /usr/share/empty/fs/aufs/posix_acl.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/posix_acl.c	2026-10-19 08:28:44.919999819 +0200
++++ linux/fs/aufs/posix_acl.c	2026-11-24 08:11:35.577424941 +0100
 @@ -0,0 +1,95 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -27300,7 +27487,7 @@ diff -urN /usr/share/empty/fs/aufs/posix_acl.c linux/fs/aufs/posix_acl.c
 +}
 diff -urN /usr/share/empty/fs/aufs/procfs.c linux/fs/aufs/procfs.c
 --- /usr/share/empty/fs/aufs/procfs.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/procfs.c	2026-10-19 08:28:44.919999819 +0200
++++ linux/fs/aufs/procfs.c	2026-11-24 08:11:35.577748924 +0100
 @@ -0,0 +1,155 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -27459,7 +27646,7 @@ diff -urN /usr/share/empty/fs/aufs/procfs.c linux/fs/aufs/procfs.c
 +}
 diff -urN /usr/share/empty/fs/aufs/rdu.c linux/fs/aufs/rdu.c
 --- /usr/share/empty/fs/aufs/rdu.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/rdu.c	2026-10-19 08:28:44.919999819 +0200
++++ linux/fs/aufs/rdu.c	2026-11-24 08:11:35.577900294 +0100
 @@ -0,0 +1,371 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -27834,7 +28021,7 @@ diff -urN /usr/share/empty/fs/aufs/rdu.c linux/fs/aufs/rdu.c
 +#endif
 diff -urN /usr/share/empty/fs/aufs/rwsem.h linux/fs/aufs/rwsem.h
 --- /usr/share/empty/fs/aufs/rwsem.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/rwsem.h	2026-10-19 08:28:44.919999819 +0200
++++ linux/fs/aufs/rwsem.h	2026-11-24 08:11:35.578013558 +0100
 @@ -0,0 +1,76 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -27914,8 +28101,8 @@ diff -urN /usr/share/empty/fs/aufs/rwsem.h linux/fs/aufs/rwsem.h
 +#endif /* __AUFS_RWSEM_H__ */
 diff -urN /usr/share/empty/fs/aufs/sbinfo.c linux/fs/aufs/sbinfo.c
 --- /usr/share/empty/fs/aufs/sbinfo.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/sbinfo.c	2026-10-19 08:28:44.919999819 +0200
-@@ -0,0 +1,302 @@
++++ linux/fs/aufs/sbinfo.c	2026-11-24 08:11:36.745235242 +0100
+@@ -0,0 +1,442 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -28102,14 +28289,73 @@ diff -urN /usr/share/empty/fs/aufs/sbinfo.c linux/fs/aufs/sbinfo.c
 +/* ---------------------------------------------------------------------- */
 +
 +/* it is ok that new 'nwt' tasks are appended while we are sleeping */
-+int si_read_lock(struct super_block *sb, int flags)
++static void si_flush(struct super_block *sb, int flags)
 +{
-+	int err;
-+
-+	err = 0;
 +	if (au_ftest_lock(flags, FLUSH))
 +		au_nwt_flush(&au_sbi(sb)->si_nowait);
++}
++
++/* wait for the pseudo-link maintainer to leave, si_rwsem not held */
++static void si_plink_maint_wait(struct super_block *sb, int flags)
++{
++	struct au_sbinfo *sbi = au_sbi(sb);
++
++	/* if there is no i_mutex lock in VFS, we don't need to wait */
++	/* AuDebugOn(!lockdep_depth(current)); */
++
++	/* gave up wake_up_bit() */
++	wait_event(sbi->si_plink_wq, !sbi->si_plink_maint_pid);
++	si_flush(sb, flags);
++}
++
++/*
++ * Never fails.  With AuLock_NOPLMW, sleeps (with si_rwsem released) while
++ * another process maintains the pseudo-links.  The si_read_lock() macro
++ * calls do_si_read_lock_noplm() instead for AuLock_NOPLM.
++ */
++void do_si_read_lock(struct super_block *sb, int flags)
++{
++	AuDebugOn(au_ftest_lock(flags, NOPLM));
 +
++	si_flush(sb, flags);
++	si_noflush_read_lock(sb);
++	if (!au_ftest_lock(flags, NOPLMW))
++		return;
++	while (au_plink_maint(sb, flags)) {
++		si_read_unlock(sb);
++		si_plink_maint_wait(sb, flags);
++		si_noflush_read_lock(sb);
++	}
++}
++
++void do_si_write_lock(struct super_block *sb, int flags)
++{
++	AuDebugOn(au_ftest_lock(flags, NOPLM));
++
++	si_flush(sb, flags);
++	/* au_debug_on(); AuDbgSleep(5); au_debug_off(); */
++	si_noflush_write_lock(sb);
++	/* pr_info("here\n"); */
++	if (!au_ftest_lock(flags, NOPLMW))
++		return;
++	while (au_plink_maint(sb, flags)) {
++		si_write_unlock(sb);
++		si_plink_maint_wait(sb, flags);
++		si_noflush_write_lock(sb);
++	}
++}
++
++/*
++ * @flags must contain AuLock_NOPLM.  Returns -EAGAIN, with si_rwsem NOT
++ * held, if another process maintains the pseudo-links; 0 with it held.
++ */
++int do_si_read_lock_noplm(struct super_block *sb, int flags)
++{
++	int err;
++
++	AuDebugOn(!au_ftest_lock(flags, NOPLM));
++
++	si_flush(sb, flags);
 +	si_noflush_read_lock(sb);
 +	err = au_plink_maint(sb, flags);
 +	if (unlikely(err))
@@ -28118,13 +28364,13 @@ diff -urN /usr/share/empty/fs/aufs/sbinfo.c linux/fs/aufs/sbinfo.c
 +	return err;
 +}
 +
-+int si_write_lock(struct super_block *sb, int flags)
++int do_si_write_lock_noplm(struct super_block *sb, int flags)
 +{
 +	int err;
 +
-+	if (au_ftest_lock(flags, FLUSH))
-+		au_nwt_flush(&au_sbi(sb)->si_nowait);
++	AuDebugOn(!au_ftest_lock(flags, NOPLM));
 +
++	si_flush(sb, flags);
 +	si_noflush_write_lock(sb);
 +	err = au_plink_maint(sb, flags);
 +	if (unlikely(err))
@@ -28133,48 +28379,124 @@ diff -urN /usr/share/empty/fs/aufs/sbinfo.c linux/fs/aufs/sbinfo.c
 +	return err;
 +}
 +
-+/* dentry and super_block lock. call at entry point */
-+int aufs_read_lock(struct dentry *dentry, int flags)
++/*
++ * dentry and super_block lock. call at entry point.
++ *
++ * Called through the aufs_read_{lock,unlock}() macros in super.h, which
++ * select one of these by @flags.  do_aufs_read_lock{,_gen_noplm}()
++ * read-lock the dinfo and the _dw variants write-lock it.  The _gen_noplm
++ * variants are for AuLock_GEN and/or AuLock_NOPLM and may fail, the others
++ * never fail.
++ */
++void do_aufs_read_lock(struct dentry *dentry, int flags)
 +{
-+	int err;
-+	struct super_block *sb;
++	AuDebugOn(au_ftest_lock(flags, GEN) || au_ftest_lock(flags, NOPLM));
++	AuDebugOn(au_ftest_lock(flags, DW));
 +
-+	sb = dentry->d_sb;
-+	err = si_read_lock(sb, flags);
-+	if (unlikely(err))
-+		goto out;
++	do_si_read_lock(dentry->d_sb, flags);
++	di_read_lock_child(dentry, flags);
++}
 +
-+	if (au_ftest_lock(flags, DW))
-+		di_write_lock_child(dentry);
-+	else
-+		di_read_lock_child(dentry, flags);
++void do_aufs_read_lock_dw(struct dentry *dentry, int flags)
++{
++	AuDebugOn(au_ftest_lock(flags, GEN) || au_ftest_lock(flags, NOPLM));
++	AuDebugOn(!au_ftest_lock(flags, DW));
 +
++	do_si_read_lock(dentry->d_sb, flags);
++	di_write_lock_child(dentry);
++}
++
++/* si_rwsem part of do_aufs_read_lock_gen_noplm{,_dw}() */
++static int aufs_si_read_lock_noplm(struct super_block *sb, int flags)
++{
++	if (au_ftest_lock(flags, NOPLM))
++		return do_si_read_lock_noplm(sb, flags);
++	do_si_read_lock(sb, flags);
++	return 0;
++}
++
++/* AuLock_GEN part of do_aufs_read_lock_gen_noplm{,_dw}(), with locks held */
++static int aufs_read_lock_test_gen(struct dentry *dentry, int flags)
++{
++	int err;
++	struct super_block *sb;
++
++	err = 0;
 +	if (au_ftest_lock(flags, GEN)) {
++		sb = dentry->d_sb;
 +		err = au_digen_test(dentry, au_sigen(sb));
 +		if (!au_opt_test(au_mntflags(sb), UDBA_NONE))
 +			AuDebugOn(!err && au_dbrange_test(dentry));
 +		else if (!err)
 +			err = au_dbrange_test(dentry);
-+		if (unlikely(err))
-+			aufs_read_unlock(dentry, flags);
 +	}
 +
++	return err;
++}
++
++/*
++ * Returns 0 with the locks held, or an error (generation mismatch, -EAGAIN
++ * for AuLock_NOPLM) with nothing held.
++ */
++int do_aufs_read_lock_gen_noplm(struct dentry *dentry, int flags)
++{
++	int err;
++
++	AuDebugOn(!au_ftest_lock(flags, GEN) && !au_ftest_lock(flags, NOPLM));
++	AuDebugOn(au_ftest_lock(flags, DW));
++
++	err = aufs_si_read_lock_noplm(dentry->d_sb, flags);
++	if (unlikely(err))
++		goto out;
++
++	di_read_lock_child(dentry, flags);
++	err = aufs_read_lock_test_gen(dentry, flags);
++	if (unlikely(err))
++		do_aufs_read_unlock(dentry, flags);
++
 +out:
 +	return err;
 +}
 +
-+void aufs_read_unlock(struct dentry *dentry, int flags)
++int do_aufs_read_lock_gen_noplm_dw(struct dentry *dentry, int flags)
 +{
-+	if (au_ftest_lock(flags, DW))
-+		di_write_unlock(dentry);
-+	else
-+		di_read_unlock(dentry, flags);
++	int err;
++
++	AuDebugOn(!au_ftest_lock(flags, GEN) && !au_ftest_lock(flags, NOPLM));
++	AuDebugOn(!au_ftest_lock(flags, DW));
++
++	err = aufs_si_read_lock_noplm(dentry->d_sb, flags);
++	if (unlikely(err))
++		goto out;
++
++	di_write_lock_child(dentry);
++	err = aufs_read_lock_test_gen(dentry, flags);
++	if (unlikely(err))
++		do_aufs_read_unlock_dw(dentry, flags);
++
++out:
++	return err;
++}
++
++void do_aufs_read_unlock(struct dentry *dentry, int flags)
++{
++	AuDebugOn(au_ftest_lock(flags, DW));
++
++	di_read_unlock(dentry, flags);
++	si_read_unlock(dentry->d_sb);
++}
++
++void do_aufs_read_unlock_dw(struct dentry *dentry, int flags)
++{
++	AuDebugOn(!au_ftest_lock(flags, DW));
++
++	di_write_unlock(dentry);
 +	si_read_unlock(dentry->d_sb);
 +}
 +
 +void aufs_write_lock(struct dentry *dentry)
 +{
-+	si_write_lock(dentry->d_sb, AuLock_FLUSH | AuLock_NOPLMW);
++	do_si_write_lock(dentry->d_sb, AuLock_FLUSH | AuLock_NOPLMW);
 +	di_write_lock_child(dentry);
 +}
 +
@@ -28191,9 +28513,14 @@ diff -urN /usr/share/empty/fs/aufs/sbinfo.c linux/fs/aufs/sbinfo.c
 +	struct super_block *sb;
 +
 +	sb = d1->d_sb;
-+	err = si_read_lock(sb, flags);
-+	if (unlikely(err))
-+		goto out;
++	if (au_ftest_lock(flags, NOPLM)) {
++		err = do_si_read_lock_noplm(sb, flags);
++		if (unlikely(err))
++			goto out;
++	} else {
++		err = 0;
++		do_si_read_lock(sb, flags);
++	}
 +
 +	di_write_lock2_child(d1, d2, au_ftest_lock(flags, DIRS));
 +
@@ -28220,8 +28547,8 @@ diff -urN /usr/share/empty/fs/aufs/sbinfo.c linux/fs/aufs/sbinfo.c
 +}
 diff -urN /usr/share/empty/fs/aufs/super.c linux/fs/aufs/super.c
 --- /usr/share/empty/fs/aufs/super.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/super.c	2026-10-19 08:28:44.919999819 +0200
-@@ -0,0 +1,858 @@
++++ linux/fs/aufs/super.c	2026-11-24 08:11:36.745455280 +0100
+@@ -0,0 +1,875 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -29024,6 +29351,23 @@ diff -urN /usr/share/empty/fs/aufs/super.c linux/fs/aufs/super.c
 +
 +/* ---------------------------------------------------------------------- */
 +
++/* the first and the last part of aufs_kill_sb(), with si_rwsem held */
++static void au_kill_sb_fin(struct super_block *sb)
++{
++	struct au_sbinfo *sbinfo = au_sbi(sb);
++
++	au_fhsm_fin(sb);
++	if (sbinfo->si_wbr_create_ops->fin)
++		sbinfo->si_wbr_create_ops->fin(sb);
++}
++
++static void au_kill_sb_pclr(struct super_block *sb)
++{
++	if (au_opt_test(au_sbi(sb)->si_mntflags, PLINK))
++		au_plink_put(sb, /*verbose*/1);
++	au_xino_clr(sb);
++}
++
 +static void aufs_kill_sb(struct super_block *sb)
 +{
 +	struct au_sbinfo *sbinfo;
@@ -29036,28 +29380,28 @@ diff -urN /usr/share/empty/fs/aufs/super.c linux/fs/aufs/super.c
 +	au_sbilist_del(sb);
 +
 +	root = sb->s_root;
-+	if (root)
++	if (root) {
 +		aufs_write_lock(root);
-+	else
-+		__si_write_lock(sb);
-+
-+	au_fhsm_fin(sb);
-+	if (sbinfo->si_wbr_create_ops->fin)
-+		sbinfo->si_wbr_create_ops->fin(sb);
-+	if (au_opt_test(sbinfo->si_mntflags, UDBA_HNOTIFY)) {
-+		au_opt_set_udba(sbinfo->si_mntflags, UDBA_NONE);
-+		au_remount_refresh(sb, /*do_idop*/0);
-+	}
-+	if (au_opt_test(sbinfo->si_mntflags, PLINK))
-+		au_plink_put(sb, /*verbose*/1);
-+	au_xino_clr(sb);
-+	if (root)
++		au_kill_sb_fin(sb);
++		if (au_opt_test(sbinfo->si_mntflags, UDBA_HNOTIFY)) {
++			au_opt_set_udba(sbinfo->si_mntflags, UDBA_NONE);
++			au_remount_refresh(sb, /*do_idop*/0);
++		}
++		au_kill_sb_pclr(sb);
 +		au_dr_opt_flush(sb);
-+
-+	if (root)
 +		aufs_write_unlock(root);
-+	else
++	} else {
++		/* the mount failed */
++		__si_write_lock(sb);
++		au_kill_sb_fin(sb);
++		/*
++		 * au_remount_refresh() requires the root.  udba=notify cannot
++		 * be left set by a failed mount.
++		 */
++		AuDebugOn(au_opt_test(sbinfo->si_mntflags, UDBA_HNOTIFY));
++		au_kill_sb_pclr(sb);
 +		__si_write_unlock(sb);
++	}
 +
 +	sbinfo->si_sb = NULL;
 +	au_nwt_flush(&sbinfo->si_nowait);
@@ -29082,8 +29426,8 @@ diff -urN /usr/share/empty/fs/aufs/super.c linux/fs/aufs/super.c
 +};
 diff -urN /usr/share/empty/fs/aufs/super.h linux/fs/aufs/super.h
 --- /usr/share/empty/fs/aufs/super.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/super.h	2026-10-19 08:28:44.919999819 +0200
-@@ -0,0 +1,606 @@
++++ linux/fs/aufs/super.h	2026-11-24 08:11:36.745683357 +0100
+@@ -0,0 +1,680 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -29355,15 +29699,89 @@ diff -urN /usr/share/empty/fs/aufs/super.h linux/fs/aufs/super.h
 +unsigned int au_sigen_inc(struct super_block *sb);
 +aufs_bindex_t au_new_br_id(struct super_block *sb);
 +
-+int si_read_lock(struct super_block *sb, int flags);
-+int si_write_lock(struct super_block *sb, int flags);
-+int aufs_read_lock(struct dentry *dentry, int flags);
-+void aufs_read_unlock(struct dentry *dentry, int flags);
++void do_si_read_lock(struct super_block *sb, int flags);
++void do_si_write_lock(struct super_block *sb, int flags);
++int do_si_read_lock_noplm(struct super_block *sb, int flags);
++int do_si_write_lock_noplm(struct super_block *sb, int flags);
++
++/*
++ * Entry points of si_rwsem.  @flags must be a constant, which selects the
++ * function at compile time, so that each of them has a fixed contract:
++ * with AuLock_NOPLM it may fail with -EAGAIN and nothing held, otherwise
++ * it never fails.
++ */
++#define si_read_lock(__sb, __flags) ({					\
++	struct super_block *_sb = (__sb);				\
++	const int _flags = (__flags);					\
++	int _err = 0;							\
++									\
++	BUILD_BUG_ON(!__builtin_constant_p(__flags));			\
++	if (au_ftest_lock(_flags, NOPLM))				\
++		_err = do_si_read_lock_noplm(_sb, _flags);		\
++	else								\
++		do_si_read_lock(_sb, _flags);				\
++	_err;								\
++})
++
++#define si_write_lock(__sb, __flags) ({					\
++	struct super_block *_sb = (__sb);				\
++	const int _flags = (__flags);					\
++	int _err = 0;							\
++									\
++	BUILD_BUG_ON(!__builtin_constant_p(__flags));			\
++	if (au_ftest_lock(_flags, NOPLM))				\
++		_err = do_si_write_lock_noplm(_sb, _flags);		\
++	else								\
++		do_si_write_lock(_sb, _flags);				\
++	_err;								\
++})
++
++void do_aufs_read_lock(struct dentry *dentry, int flags);
++void do_aufs_read_lock_dw(struct dentry *dentry, int flags);
++int do_aufs_read_lock_gen_noplm(struct dentry *dentry, int flags);
++int do_aufs_read_lock_gen_noplm_dw(struct dentry *dentry, int flags);
++void do_aufs_read_unlock(struct dentry *dentry, int flags);
++void do_aufs_read_unlock_dw(struct dentry *dentry, int flags);
 +void aufs_write_lock(struct dentry *dentry);
 +void aufs_write_unlock(struct dentry *dentry);
 +int aufs_read_and_write_lock2(struct dentry *d1, struct dentry *d2, int flags);
 +void aufs_read_and_write_unlock2(struct dentry *d1, struct dentry *d2);
 +
++/*
++ * Entry points of aufs_read_{lock,unlock}().  @flags must be a constant,
++ * which selects the function at compile time.  AuLock_DW write-locks the
++ * dinfo instead of read-locking it.  With AuLock_GEN or AuLock_NOPLM,
++ * aufs_read_lock() may fail with nothing held, otherwise it never fails.
++ */
++#define aufs_read_lock(__d, __flags) ({					\
++	struct dentry *_d = (__d);					\
++	const int _flags = (__flags);					\
++	int _err = 0;							\
++									\
++	BUILD_BUG_ON(!__builtin_constant_p(__flags));			\
++	if (au_ftest_lock(_flags, GEN) || au_ftest_lock(_flags, NOPLM)) { \
++		if (au_ftest_lock(_flags, DW))				\
++			_err = do_aufs_read_lock_gen_noplm_dw(_d, _flags); \
++		else							\
++			_err = do_aufs_read_lock_gen_noplm(_d, _flags);	\
++	} else if (au_ftest_lock(_flags, DW))				\
++		do_aufs_read_lock_dw(_d, _flags);			\
++	else								\
++		do_aufs_read_lock(_d, _flags);				\
++	_err;								\
++})
++
++#define aufs_read_unlock(__d, __flags) do {				\
++	struct dentry *_d = (__d);					\
++	const int _flags = (__flags);					\
++									\
++	BUILD_BUG_ON(!__builtin_constant_p(__flags));			\
++	if (au_ftest_lock(_flags, DW))					\
++		do_aufs_read_unlock_dw(_d, _flags);			\
++	else								\
++		do_aufs_read_unlock(_d, _flags);			\
++} while (0)
++
 +/* wbr_policy.c */
 +extern struct au_wbr_copyup_operations au_wbr_copyup_ops[];
 +extern struct au_wbr_create_operations au_wbr_create_ops[];
@@ -29692,7 +30110,7 @@ diff -urN /usr/share/empty/fs/aufs/super.h linux/fs/aufs/super.h
 +#endif /* __AUFS_SUPER_H__ */
 diff -urN /usr/share/empty/fs/aufs/sysaufs.c linux/fs/aufs/sysaufs.c
 --- /usr/share/empty/fs/aufs/sysaufs.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/sysaufs.c	2026-10-19 08:28:44.919999819 +0200
++++ linux/fs/aufs/sysaufs.c	2026-11-24 08:11:35.578682134 +0100
 @@ -0,0 +1,81 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -29777,7 +30195,7 @@ diff -urN /usr/share/empty/fs/aufs/sysaufs.c linux/fs/aufs/sysaufs.c
 +}
 diff -urN /usr/share/empty/fs/aufs/sysaufs.h linux/fs/aufs/sysaufs.h
 --- /usr/share/empty/fs/aufs/sysaufs.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/sysaufs.h	2026-10-19 08:28:44.919999819 +0200
++++ linux/fs/aufs/sysaufs.h	2026-11-24 08:11:35.578682134 +0100
 @@ -0,0 +1,91 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -29872,7 +30290,7 @@ diff -urN /usr/share/empty/fs/aufs/sysaufs.h linux/fs/aufs/sysaufs.h
 +#endif /* __SYSAUFS_H__ */
 diff -urN /usr/share/empty/fs/aufs/sysfs.c linux/fs/aufs/sysfs.c
 --- /usr/share/empty/fs/aufs/sysfs.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/sysfs.c	2026-10-19 08:28:44.923333153 +0200
++++ linux/fs/aufs/sysfs.c	2026-11-24 08:11:35.578906020 +0100
 @@ -0,0 +1,361 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -30237,7 +30655,7 @@ diff -urN /usr/share/empty/fs/aufs/sysfs.c linux/fs/aufs/sysfs.c
 +}
 diff -urN /usr/share/empty/fs/aufs/sysrq.c linux/fs/aufs/sysrq.c
 --- /usr/share/empty/fs/aufs/sysrq.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/sysrq.c	2026-10-19 08:28:44.923333153 +0200
++++ linux/fs/aufs/sysrq.c	2026-11-24 08:11:35.579049393 +0100
 @@ -0,0 +1,144 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -30385,7 +30803,7 @@ diff -urN /usr/share/empty/fs/aufs/sysrq.c linux/fs/aufs/sysrq.c
 +}
 diff -urN /usr/share/empty/fs/aufs/vdir.c linux/fs/aufs/vdir.c
 --- /usr/share/empty/fs/aufs/vdir.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/vdir.c	2026-10-19 08:28:44.923333153 +0200
++++ linux/fs/aufs/vdir.c	2026-11-24 08:11:35.579282536 +0100
 @@ -0,0 +1,883 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -31272,7 +31690,7 @@ diff -urN /usr/share/empty/fs/aufs/vdir.c linux/fs/aufs/vdir.c
 +}
 diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 --- /usr/share/empty/fs/aufs/vfsub.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/vfsub.c	2026-10-19 08:28:44.923333153 +0200
++++ linux/fs/aufs/vfsub.c	2026-11-24 08:11:35.579470107 +0100
 @@ -0,0 +1,1039 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -32315,7 +32733,7 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.c linux/fs/aufs/vfsub.c
 +}
 diff -urN /usr/share/empty/fs/aufs/vfsub.h linux/fs/aufs/vfsub.h
 --- /usr/share/empty/fs/aufs/vfsub.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/vfsub.h	2026-10-19 08:28:44.923333153 +0200
++++ linux/fs/aufs/vfsub.h	2026-11-24 08:11:35.579624499 +0100
 @@ -0,0 +1,422 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -32741,7 +33159,7 @@ diff -urN /usr/share/empty/fs/aufs/vfsub.h linux/fs/aufs/vfsub.h
 +#endif /* __AUFS_VFSUB_H__ */
 diff -urN /usr/share/empty/fs/aufs/wbr_policy.c linux/fs/aufs/wbr_policy.c
 --- /usr/share/empty/fs/aufs/wbr_policy.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/wbr_policy.c	2026-10-19 08:28:44.923333153 +0200
++++ linux/fs/aufs/wbr_policy.c	2026-11-24 08:11:35.579830581 +0100
 @@ -0,0 +1,828 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -33573,7 +33991,7 @@ diff -urN /usr/share/empty/fs/aufs/wbr_policy.c linux/fs/aufs/wbr_policy.c
 +};
 diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
 --- /usr/share/empty/fs/aufs/whout.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/whout.c	2026-10-19 08:28:44.923333153 +0200
++++ linux/fs/aufs/whout.c	2026-11-24 08:11:36.745932776 +0100
 @@ -0,0 +1,1060 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -34051,6 +34469,7 @@ diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
 +	if (wbr)
 +		WbrWhMustWriteLock(wbr);
 +
++	need_drop = 0;
 +	for (i = 0; i < AuBrWh_Last; i++) {
 +		/* doubly whiteouted */
 +		struct dentry *d;
@@ -34072,7 +34491,6 @@ diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
 +			wbr->wbr_wh[i] = NULL;
 +		}
 +
-+	need_drop = 0;
 +	err = vfsub_mnt_want_write(path.mnt);
 +	if (unlikely(err))
 +		goto out_err;
@@ -34637,7 +35055,7 @@ diff -urN /usr/share/empty/fs/aufs/whout.c linux/fs/aufs/whout.c
 +}
 diff -urN /usr/share/empty/fs/aufs/whout.h linux/fs/aufs/whout.h
 --- /usr/share/empty/fs/aufs/whout.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/whout.h	2026-10-19 08:28:44.923333153 +0200
++++ linux/fs/aufs/whout.h	2026-11-24 08:11:35.580169720 +0100
 @@ -0,0 +1,74 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -34715,7 +35133,7 @@ diff -urN /usr/share/empty/fs/aufs/whout.h linux/fs/aufs/whout.h
 +#endif /* __AUFS_WHOUT_H__ */
 diff -urN /usr/share/empty/fs/aufs/wkq.c linux/fs/aufs/wkq.c
 --- /usr/share/empty/fs/aufs/wkq.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/wkq.c	2026-10-19 08:28:44.923333153 +0200
++++ linux/fs/aufs/wkq.c	2026-11-24 08:11:35.580290124 +0100
 @@ -0,0 +1,357 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
@@ -35076,7 +35494,7 @@ diff -urN /usr/share/empty/fs/aufs/wkq.c linux/fs/aufs/wkq.c
 +}
 diff -urN /usr/share/empty/fs/aufs/wkq.h linux/fs/aufs/wkq.h
 --- /usr/share/empty/fs/aufs/wkq.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/wkq.h	2026-10-19 08:28:44.923333153 +0200
++++ linux/fs/aufs/wkq.h	2026-11-24 08:11:35.580414660 +0100
 @@ -0,0 +1,76 @@
 +/* SPDX-License-Identifier: GPL-2.0 */
 +/*
@@ -35156,8 +35574,8 @@ diff -urN /usr/share/empty/fs/aufs/wkq.h linux/fs/aufs/wkq.h
 +#endif /* __AUFS_WKQ_H__ */
 diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 --- /usr/share/empty/fs/aufs/xattr.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/xattr.c	2026-10-19 08:28:44.923333153 +0200
-@@ -0,0 +1,347 @@
++++ linux/fs/aufs/xattr.c	2026-11-24 08:11:36.746076733 +0100
+@@ -0,0 +1,358 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2014-2026 Junjiro R. Okajima
@@ -35379,48 +35797,59 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +	} u;
 +};
 +
-+static ssize_t au_lgxattr(struct dentry *dentry, struct inode *inode,
-+			  struct au_lgxattr *arg)
++/* the caller holds the dinfo lock of the dentry @h_path came from */
++static ssize_t au_do_lgxattr(struct path *h_path, struct au_lgxattr *arg)
 +{
 +	ssize_t err;
-+	int reenter;
-+	struct path h_path;
-+	struct super_block *sb;
 +
-+	sb = dentry->d_sb;
-+	reenter = au_smack_reentering(sb);
-+	if (!reenter) {
-+		err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM);
-+		if (unlikely(err))
-+			goto out;
-+	}
-+	err = au_h_path_getattr(dentry, inode, /*force*/1, &h_path, reenter);
-+	if (unlikely(err))
-+		goto out_si;
-+	if (unlikely(!h_path.dentry))
++	err = 0;
++	if (unlikely(!h_path->dentry))
 +		/* illegally overlapped or something */
-+		goto out_di; /* pretending success */
++		goto out; /* pretending success */
 +
 +	/* always topmost entry only */
 +	switch (arg->type) {
 +	case AU_XATTR_LIST:
-+		err = vfs_listxattr(h_path.dentry,
++		err = vfs_listxattr(h_path->dentry,
 +				    arg->u.list.list, arg->u.list.size);
 +		break;
 +	case AU_XATTR_GET:
-+		AuDebugOn(d_is_negative(h_path.dentry));
-+		err = vfs_getxattr(mnt_idmap(h_path.mnt), h_path.dentry,
++		AuDebugOn(d_is_negative(h_path->dentry));
++		err = vfs_getxattr(mnt_idmap(h_path->mnt), h_path->dentry,
 +				   arg->u.get.name, arg->u.get.value,
 +				   arg->u.get.size);
 +		break;
 +	}
 +
-+out_di:
-+	if (!reenter)
++out:
++	return err;
++}
++
++static ssize_t au_lgxattr(struct dentry *dentry, struct inode *inode,
++			  struct au_lgxattr *arg)
++{
++	ssize_t err;
++	struct path h_path;
++	struct super_block *sb;
++
++	sb = dentry->d_sb;
++	if (au_smack_reentering(sb)) {
++		/* locks held by the aufs operation we re-entered from */
++		au_h_path_getattr_locked(dentry, inode, /*force*/1, &h_path);
++		err = au_do_lgxattr(&h_path, arg);
++		goto out;
++	}
++
++	err = si_read_lock(sb, AuLock_FLUSH | AuLock_NOPLM);
++	if (unlikely(err))
++		goto out;
++	err = au_h_path_getattr(dentry, inode, /*force*/1, &h_path);
++	if (!err) {
++		err = au_do_lgxattr(&h_path, arg);
 +		di_read_unlock(dentry, AuLock_IR);
-+out_si:
-+	if (!reenter)
-+		si_read_unlock(sb);
++	}
++	si_read_unlock(sb);
++
 +out:
 +	AuTraceErr(err);
 +	return err;
@@ -35507,8 +35936,8 @@ diff -urN /usr/share/empty/fs/aufs/xattr.c linux/fs/aufs/xattr.c
 +}
 diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 --- /usr/share/empty/fs/aufs/xino.c	1970-01-01 01:00:00.000000000 +0100
-+++ linux/fs/aufs/xino.c	2026-10-19 08:28:44.923333153 +0200
-@@ -0,0 +1,1913 @@
++++ linux/fs/aufs/xino.c	2026-11-24 08:11:36.746421171 +0100
+@@ -0,0 +1,1926 @@
 +// SPDX-License-Identifier: GPL-2.0
 +/*
 + * Copyright (C) 2005-2026 Junjiro R. Okajima
@@ -35654,6 +36083,20 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +
 +/* ---------------------------------------------------------------------- */
 +
++/* open @fpath, and on success dget and lock its parent dir */
++static struct file *au_xino_do_open(char *fpath, struct dentry **h_parent)
++{
++	struct file *file;
++
++	file = vfsub_filp_open(fpath, O_RDWR | O_CREAT | O_EXCL | O_LARGEFILE
++			       /* | __FMODE_NONOTIFY */,
++			       0666);
++	if (!IS_ERR(file))
++		*h_parent = au_dget_parent_lock(file->f_path.dentry,
++						AuLsc_I_PARENT);
++	return file;
++}
++
 +/*
 + * create and set a new xino file
 + */
@@ -35671,14 +36114,14 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +	 * hnotify is disabled so we have no notify events to ignore.
 +	 * when a user specified the xino, we cannot get au_hdir to be ignored.
 +	 */
-+	if (!wbrtop)
++	if (wbrtop)
++		file = au_xino_do_open(fpath, &h_parent);
++	else {
 +		mutex_lock(&mtx);
-+	file = vfsub_filp_open(fpath, O_RDWR | O_CREAT | O_EXCL | O_LARGEFILE
-+			       /* | __FMODE_NONOTIFY */,
-+			       0666);
++		file = au_xino_do_open(fpath, &h_parent);
++		mutex_unlock(&mtx);
++	}
 +	if (IS_ERR(file)) {
-+		if (!wbrtop)
-+			mutex_unlock(&mtx);
 +		if (!silent)
 +			pr_err("open %s(%ld)\n", fpath, PTR_ERR(file));
 +		return file;
@@ -35687,9 +36130,6 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +	/* keep file count */
 +	err = 0;
 +	d = file->f_path.dentry;
-+	h_parent = au_dget_parent_lock(d, AuLsc_I_PARENT);
-+	if (!wbrtop)
-+		mutex_unlock(&mtx);
 +	h_dir = d_inode(h_parent);
 +	inode = file_inode(file);
 +	if (vfsub_inode_nlink(inode, AU_I_BRANCH)) {
@@ -35759,8 +36199,10 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +
 +	path.mnt = base->mnt;
 +	err = vfsub_mnt_want_write(path.mnt);
-+	if (unlikely(err))
++	if (unlikely(err)) {
++		file = ERR_PTR(err);
 +		goto out_dput;
++	}
 +
 +	err = vfs_create(mnt_idmap(base->mnt), path.dentry, 0666, NULL);
 +	if (unlikely(err)) {
@@ -37424,7 +37866,7 @@ diff -urN /usr/share/empty/fs/aufs/xino.c linux/fs/aufs/xino.c
 +}
 diff -urN /usr/share/empty/include/uapi/linux/aufs_type.h linux/include/uapi/linux/aufs_type.h
 --- /usr/share/empty/include/uapi/linux/aufs_type.h	1970-01-01 01:00:00.000000000 +0100
-+++ linux/include/uapi/linux/aufs_type.h	2026-10-19 08:28:44.923333153 +0200
++++ linux/include/uapi/linux/aufs_type.h	2026-11-24 08:11:36.746622199 +0100
 @@ -0,0 +1,434 @@
 +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
 +/*
@@ -37455,7 +37897,7 @@ diff -urN /usr/share/empty/include/uapi/linux/aufs_type.h linux/include/uapi/lin
 +#include <limits.h>
 +#endif /* __KERNEL__ */
 +
-+#define AUFS_VERSION	"7.x-rcN-20260914"
++#define AUFS_VERSION	"7.3-20261116"
 +
 +/* todo? move this to linux-2.6.19/include/magic.h */
 +#define AUFS_SUPER_MAGIC	('a' << 24 | 'u' << 16 | 'f' << 8 | 's')
@@ -37861,7 +38303,7 @@ diff -urN /usr/share/empty/include/uapi/linux/aufs_type.h linux/include/uapi/lin
 +
 +#endif /* __AUFS_TYPE_H__ */
 SPDX-License-Identifier: GPL-2.0
-aufs7.x-rcN kbuild patch
+aufs7.3 kbuild patch
 
 diff --git a/fs/Kconfig b/fs/Kconfig
 index e05917adcd608..0dd0d66713e13 100644
@@ -37885,10 +38327,10 @@ index 055dfc23d82b6..eff984d7f1cb2 100644
  obj-$(CONFIG_RESCTRL_FS)	+= resctrl/
 +obj-$(CONFIG_AUFS_FS)		+= aufs/
 SPDX-License-Identifier: GPL-2.0
-aufs7.x-rcN base patch
+aufs7.3 base patch
 
 diff --git a/MAINTAINERS b/MAINTAINERS
-index 6215fcb077705..e5ec3e394bd66 100644
+index 782389bd5cd3d..6470f865e0d2c 100644
 --- a/MAINTAINERS
 +++ b/MAINTAINERS
 @@ -4364,6 +4364,19 @@ F:	kernel/audit*
@@ -37948,7 +38390,7 @@ index 758c20678bf6c..179f838c560d4 100644
  
  static ssize_t loop_attr_show(struct device *dev, char *page,
 diff --git a/fs/dcache.c b/fs/dcache.c
-index 1b1a81f10da67..2bc3e63fe702d 100644
+index f44c7b39c3b38..43f0a97435a48 100644
 --- a/fs/dcache.c
 +++ b/fs/dcache.c
 @@ -1429,6 +1429,10 @@ enum d_walk_ret {
@@ -37972,7 +38414,7 @@ index 1b1a81f10da67..2bc3e63fe702d 100644
  {
  	struct dentry *this_parent, *dentry;
 diff --git a/fs/exec.c b/fs/exec.c
-index 745f6eb5279e6..0cb555d449731 100644
+index a5269b5e00df1..377c59578c6a0 100644
 --- a/fs/exec.c
 +++ b/fs/exec.c
 @@ -782,6 +782,9 @@ static struct file *do_open_execat(int fd, struct filename *name, int flags)
@@ -37986,7 +38428,7 @@ index 745f6eb5279e6..0cb555d449731 100644
  	file = do_file_open(fd, name, &open_exec_flags);
  	if (IS_ERR(file))
 diff --git a/fs/fcntl.c b/fs/fcntl.c
-index c158f082f1da4..30aadd42ed8ee 100644
+index 9b71bc9d71d15..75c5416d0e0b7 100644
 --- a/fs/fcntl.c
 +++ b/fs/fcntl.c
 @@ -36,7 +36,7 @@
@@ -38008,7 +38450,7 @@ index c158f082f1da4..30aadd42ed8ee 100644
  		return error;
  
 diff --git a/fs/fhandle.c b/fs/fhandle.c
-index f8829231e3d75..1ec27a6546f8e 100644
+index d22f2e065677a..9b291d8961a1f 100644
 --- a/fs/fhandle.c
 +++ b/fs/fhandle.c
 @@ -156,6 +156,9 @@ SYSCALL_DEFINE5(name_to_handle_at, int, dfd, const char __user *, name,
@@ -38036,7 +38478,7 @@ index ae19e51365986..3725f6730b8e5 100644
  			 (flags & FSPICK_EMPTY_PATH) ? LOOKUP_EMPTY : 0);
  	ret = filename_lookup(dfd, filename, lookup_flags, &target, NULL);
 diff --git a/fs/namei.c b/fs/namei.c
-index 20a6534ea3eff..e04ea1e86911c 100644
+index e45e30603215d..69da2972359ba 100644
 --- a/fs/namei.c
 +++ b/fs/namei.c
 @@ -3779,7 +3779,7 @@ static struct dentry *lock_two_directories(struct dentry *p1, struct dentry *p2)
@@ -38058,10 +38500,10 @@ index 20a6534ea3eff..e04ea1e86911c 100644
  	inode_unlock(p1->d_inode);
  	if (p1 != p2) {
 diff --git a/fs/namespace.c b/fs/namespace.c
-index ae5dc64f8b457..f8d34899fc58b 100644
+index c30f063742f40..2a3aa15806d79 100644
 --- a/fs/namespace.c
 +++ b/fs/namespace.c
-@@ -3218,6 +3218,9 @@ static struct file *vfs_open_tree(int dfd, const char __user *filename, unsigned
+@@ -3334,6 +3334,9 @@ static struct file *vfs_open_tree(int dfd, const char __user *filename, unsigned
  		lookup_flags &= ~LOOKUP_AUTOMOUNT;
  	if (flags & AT_SYMLINK_NOFOLLOW)
  		lookup_flags &= ~LOOKUP_FOLLOW;
@@ -38071,7 +38513,7 @@ index ae5dc64f8b457..f8d34899fc58b 100644
  
  	/*
  	 * If we create a new mount namespace with the cloned mount tree we
-@@ -5168,6 +5171,9 @@ SYSCALL_DEFINE5(mount_setattr, int, dfd, const char __user *, path,
+@@ -5334,6 +5337,9 @@ SYSCALL_DEFINE5(mount_setattr, int, dfd, const char __user *, path,
  		lookup_flags &= ~LOOKUP_AUTOMOUNT;
  	if (flags & AT_SYMLINK_NOFOLLOW)
  		lookup_flags &= ~LOOKUP_FOLLOW;
@@ -38129,7 +38571,7 @@ index 9d8f63e2fd1ab..d2b70cb432d1d 100644
  {
  	if (unlikely(!out->f_op->splice_write))
 diff --git a/include/linux/fs.h b/include/linux/fs.h
-index f9d1e05e8ae68..a8faa51d38605 100644
+index deb411e866617..840980f456470 100644
 --- a/include/linux/fs.h
 +++ b/include/linux/fs.h
 @@ -1385,6 +1385,7 @@ extern void fasync_free(struct fasync_struct *);
@@ -38314,7 +38756,7 @@ index ee69dd9d970e5..22ecfa69b9711 100644
  uses-libc += asm/sigcontext.h
  endif
 SPDX-License-Identifier: GPL-2.0
-aufs7.x-rcN mmap patch
+aufs7.3 mmap patch
 
 diff --git a/fs/Makefile b/fs/Makefile
 index eff984d7f1cb2..133c0f95ddb9d 100644
@@ -38440,10 +38882,10 @@ index d362919f4f688..79a2590d40f4d 100644
  		ino = inode->i_ino;
  		pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT;
 diff --git a/include/linux/fs.h b/include/linux/fs.h
-index a8faa51d38605..8cfff2b5887c4 100644
+index 840980f456470..181e67fd14606 100644
 --- a/include/linux/fs.h
 +++ b/include/linux/fs.h
-@@ -2522,6 +2522,21 @@ static inline void backing_file_set_security(struct file *f, void *security)
+@@ -2525,6 +2525,21 @@ static inline void backing_file_set_security(struct file *f, void *security)
  }
  #endif /* CONFIG_SECURITY */
  
@@ -38465,7 +38907,7 @@ index a8faa51d38605..8cfff2b5887c4 100644
  /*
   * When mmapping a file on a stackable filesystem (e.g., overlayfs), the file
   * stored in ->vm_file is a backing file whose f_inode is on the underlying
-@@ -2534,15 +2549,25 @@ static inline void backing_file_set_security(struct file *f, void *security)
+@@ -2537,15 +2552,25 @@ static inline void backing_file_set_security(struct file *f, void *security)
  /* Get the path to display in /proc/<pid>/maps */
  static inline const struct path *file_user_path(const struct file *f)
  {
@@ -38492,10 +38934,10 @@ index a8faa51d38605..8cfff2b5887c4 100644
  }
  
 SPDX-License-Identifier: GPL-2.0
-aufs7.x-rcN standalone patch
+aufs7.3 standalone patch
 
 diff --git a/fs/dcache.c b/fs/dcache.c
-index 2bc3e63fe702d..8c24071683a18 100644
+index 43f0a97435a48..6e8c4e3947cbf 100644
 --- a/fs/dcache.c
 +++ b/fs/dcache.c
 @@ -1540,6 +1540,7 @@ void d_walk(struct dentry *parent, void *data,
@@ -38507,7 +38949,7 @@ index 2bc3e63fe702d..8c24071683a18 100644
  struct check_mount {
  	struct vfsmount *mnt;
 diff --git a/fs/exec.c b/fs/exec.c
-index 0cb555d449731..ca17d7adb0d0e 100644
+index 377c59578c6a0..a160305d2c0c8 100644
 --- a/fs/exec.c
 +++ b/fs/exec.c
 @@ -122,6 +122,7 @@ bool path_noexec(const struct path *path)
@@ -38519,7 +38961,7 @@ index 0cb555d449731..ca17d7adb0d0e 100644
  #ifdef CONFIG_MMU
  /*
 diff --git a/fs/fcntl.c b/fs/fcntl.c
-index 30aadd42ed8ee..78db19b2a4f51 100644
+index 75c5416d0e0b7..58a77399057a4 100644
 --- a/fs/fcntl.c
 +++ b/fs/fcntl.c
 @@ -89,6 +89,7 @@ int setfl(int fd, struct file * filp, unsigned int arg)
@@ -38531,7 +38973,7 @@ index 30aadd42ed8ee..78db19b2a4f51 100644
  /*
   * Allocate an file->f_owner struct if it doesn't exist, handling racing
 diff --git a/fs/file_table.c b/fs/file_table.c
-index c68b8c0a4097a..5367fd8ad12db 100644
+index e2665eaa6f8c2..6e1da727501a8 100644
 --- a/fs/file_table.c
 +++ b/fs/file_table.c
 @@ -281,6 +281,7 @@ struct file *alloc_empty_file(int flags, const struct cred *cred)
@@ -38543,7 +38985,7 @@ index c68b8c0a4097a..5367fd8ad12db 100644
  /*
   * Variant of alloc_empty_file() that doesn't check and modify nr_files.
 diff --git a/fs/namei.c b/fs/namei.c
-index e04ea1e86911c..ebfe0ca6e6287 100644
+index 69da2972359ba..4b4584c5792cb 100644
 --- a/fs/namei.c
 +++ b/fs/namei.c
 @@ -3789,6 +3789,7 @@ struct dentry *lock_rename(struct dentry *p1, struct dentry *p2)
@@ -38563,10 +39005,26 @@ index e04ea1e86911c..ebfe0ca6e6287 100644
  /**
   * __start_renaming - lookup and lock names for rename
 diff --git a/fs/namespace.c b/fs/namespace.c
-index f8d34899fc58b..821a7b9840809 100644
+index 2a3aa15806d79..7e6c6717b2600 100644
 --- a/fs/namespace.c
 +++ b/fs/namespace.c
-@@ -6345,6 +6345,7 @@ bool our_mnt(struct vfsmount *mnt)
+@@ -2344,6 +2344,7 @@ const struct path *collect_paths(const struct path *path,
+ 		path_get(p);
+ 	return res;
+ }
++EXPORT_SYMBOL_GPL(collect_paths);
+ 
+ void drop_collected_paths(const struct path *paths, const struct path *prealloc)
+ {
+@@ -2352,6 +2353,7 @@ void drop_collected_paths(const struct path *paths, const struct path *prealloc)
+ 	if (paths != prealloc)
+ 		kfree(paths);
+ }
++EXPORT_SYMBOL_GPL(drop_collected_paths);
+ 
+ static struct mnt_namespace *alloc_mnt_ns(struct user_namespace *, bool);
+ 
+@@ -6558,6 +6560,7 @@ bool our_mnt(struct vfsmount *mnt)
  {
  	return check_mnt(real_mount(mnt));
  }
@@ -38756,7 +39214,7 @@ index 2ee276ab15c5b..870c7383207c6 100644
  /**
   * security_task_alloc() - Allocate a task's LSM blob
 SPDX-License-Identifier: GPL-2.0
-aufs7.x-rcN loopback patch
+aufs7.3 loopback patch
 
 diff --git a/drivers/block/loop.c b/drivers/block/loop.c
 index 179f838c560d4..19849d7200a06 100644
@@ -38907,11 +39365,11 @@ index 179f838c560d4..19849d7200a06 100644
  
  static int loop_clr_fd(struct loop_device *lo)
 diff --git a/fs/aufs/f_op.c b/fs/aufs/f_op.c
-index 33fa6c3863563..2ecbfce5feb6f 100644
+index 94fd721d17d68..938c2c27a634f 100644
 --- a/fs/aufs/f_op.c
 +++ b/fs/aufs/f_op.c
-@@ -326,7 +326,7 @@ static ssize_t aufs_read_iter(struct kiocb *kio, struct iov_iter *iov_iter)
- 	if (IS_ERR(h_file))
+@@ -342,7 +342,7 @@ static ssize_t aufs_read_iter(struct kiocb *kio, struct iov_iter *iov_iter)
+ 	if (unlikely(err))
  		goto out;
  
 -	if (au_test_loopback_kthread()) {
@@ -38966,7 +39424,7 @@ index 9c732a84586b3..82d28e85434fa 100644
  
  #endif /* __KERNEL__ */
 diff --git a/fs/aufs/super.c b/fs/aufs/super.c
-index 58ce8047f5573..6010f687f4d96 100644
+index c7f34e47325f3..23159c59e7f15 100644
 --- a/fs/aufs/super.c
 +++ b/fs/aufs/super.c
 @@ -757,7 +757,10 @@ const struct super_operations aufs_sop = {
diff --git a/kernel-multiarch.config b/kernel-multiarch.config
index 091db48a..400daabe 100644
--- a/kernel-multiarch.config
+++ b/kernel-multiarch.config
@@ -11094,6 +11094,7 @@ RPMSG_VIRTIO all=m
 #-
 RTC_CLASS all=y
 RTC_HCTOSYS all=y
+RTC_HCTOSYS_TIME32_LIMIT all=y
 RTC_HCTOSYS_DEVICE all="rtc0"
 RTC_SYSTOHC all=y
 RTC_SYSTOHC_DEVICE all="rtc0"
@@ -12128,7 +12129,7 @@ SERIAL_8250_FOURPORT alpha=m i386=m
 SERIAL_8250_ACCENT alpha=m i386=m
 SERIAL_8250_BOCA alpha=m i386=m
 SERIAL_8250_EXAR_ST16C554 alpha=m i386=m
-SERIAL_8250_HUB6 alpha=m i386=m
+SERIAL_8250_HUB6 alpha=y i386=y
 SERIAL_8250_PCI1XXXX all=m
 SERIAL_8250_ASPEED_VUART arm=m arm64=m
 SERIAL_8250_BCM2835AUX arm=y arm64=y
diff --git a/update-source.sh b/update-source.sh
index 2655ee18..cd0ec50e 100755
--- a/update-source.sh
+++ b/update-source.sh
@@ -1,8 +1,8 @@
 #!/bin/sh
 set -xe
 
-BRANCH=aufs7.x-rcN
-#BRANCH=aufs7.1
+BRANCH=aufs7.3
+#BRANCH=aufs7.x-rcN
 
 # aufs7
 [ -d aufs-standalone ] || git clone https://github.com/sfjro/aufs-standalone.git
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/kernel.git/commitdiff/066a59c43948fb8561a4772fb33640d70ae23253



More information about the pld-cvs-commit mailing list