[SRU][J:linux-azure][PATCH 1/1] UBUNTU: SAUCE: NFSv4.x: by default serialize open/close operations.
Vinicius Peixoto
vinicius.peixoto at canonical.com
Tue Jan 20 19:51:31 UTC 2026
From: NeilBrown <neilb at suse.com>
BugLink: https://bugs.launchpad.net/bugs/2138752
NFSv4.1 and later allow open, open_downgrade, and close operations
on a given file to occur in parallel and provides a way for the server
to unambiguously indicate which operation was processed last.
Unfortuantely some servers (Azure) do not handle the possible races
properly.
The easiest way to ensure correct behaviour is to revert to the
NFSv4.0 practice of serializing these operations.
By default, opens are PARALLELIZED.
With nfs4 module parameter "serialize_opens=Y", the opens will be
SERIALIZED - they cannot occur in parallel.
Signed-off-by: NeilBrown <neilb at suse.com>
Acked-by: NeilBrown <neilb at suse.com>
(cherry-picked from commit d543ea166058 https://code.opensuse.org/kernel/kernel-source)
[vpeixoto: this is a bandaid for an NFS server bug and will not be
accepted by upstream, but is mostly harmless.]
Signed-off-by: Vinicius Peixoto <vinicius.peixoto at canonical.com>
---
fs/nfs/nfs4proc.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index a80d7a0a1b8a..040202a3076d 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -10455,9 +10455,16 @@ static const struct nfs4_minor_version_ops nfs_v4_0_minor_ops = {
};
#if defined(CONFIG_NFS_V4_1)
+static bool serialize_opens = false;
+module_param(serialize_opens, bool, 0644);
+MODULE_PARM_DESC(serialize_opens,
+ "Serialize all open/close to each file - avoids some server bugs");
+
static struct nfs_seqid *
nfs_alloc_no_seqid(struct nfs_seqid_counter *arg1, gfp_t arg2)
{
+ if (serialize_opens)
+ return nfs_alloc_seqid(arg1, arg2);
return NULL;
}
--
2.51.0
More information about the kernel-team
mailing list