Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

gfs2: don't allow delegations to be set on directories

With the advent of directory leases, it's necessary to set the
->setlease() handler in directory file_operations to properly deny them.

In the "nolock" case however, there is no need to deny them.

Fixes: e6d28ebc17eb ("filelock: push the S_ISREG check down to ->setlease handlers")
Signed-off-by: Jeff Layton <jlayton@kernel.org>
Link: https://patch.msgid.link/20260107-setlease-6-19-v1-4-85f034abcc57@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>

authored by

Jeff Layton and committed by
Christian Brauner
ce946c4f 5d65a70b

+1
+1
fs/gfs2/file.c
··· 1608 1608 .lock = gfs2_lock, 1609 1609 .flock = gfs2_flock, 1610 1610 .llseek = default_llseek, 1611 + .setlease = simple_nosetlease, 1611 1612 .fop_flags = FOP_ASYNC_LOCK, 1612 1613 }; 1613 1614