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

Configure Feed

Select the types of activity you want to include in your feed.

Merge patch series "vfs: properly deny directory leases on filesystems with special lease handling"

Jeff Layton <jlayton@kernel.org> says:

Filesystems currently have to set the ->setlease() method explicitly in
order to deny attempts to set a lease or delegation. With the advent of
directory delegations, we now need to set ->setlease on the directory
file_operations for several filesystems to simple_nosetlease() to ensure
this.

This patchset does that. There should be no noticeable change in
behavior, other than fixing the support detection in xfstests, allowing
lease/delegation tests to be properly skipped on these filesystems.

It's probably simplest to merge these all at once via Christian's tree
if he's amenable, but Acks would be welcome. Ideally these would go in
for v6.19.

Long term, I think it would be best to change leases/delegations to be
an opt-in thing, such that leases are always denied by default if the
method isn't set. That's a larger patchset though as we'd need to audit
all of the file_operations that currently have ->setlease() as NULL.

* patches from https://patch.msgid.link/20260107-setlease-6-19-v1-0-85f034abcc57@kernel.org:
vboxsf: don't allow delegations to be set on directories
ceph: don't allow delegations to be set on directories
gfs2: don't allow delegations to be set on directories
9p: don't allow delegations to be set on directories
smb/client: properly disallow delegations on directories
nfs: properly disallow delegation requests on directories

Link: https://patch.msgid.link/20260107-setlease-6-19-v1-0-85f034abcc57@kernel.org
Signed-off-by: Christian Brauner <brauner@kernel.org>

+8 -5
+2
fs/9p/vfs_dir.c
··· 242 242 .iterate_shared = v9fs_dir_readdir, 243 243 .open = v9fs_file_open, 244 244 .release = v9fs_dir_release, 245 + .setlease = simple_nosetlease, 245 246 }; 246 247 247 248 const struct file_operations v9fs_dir_operations_dotl = { ··· 252 251 .open = v9fs_file_open, 253 252 .release = v9fs_dir_release, 254 253 .fsync = v9fs_file_fsync_dotl, 254 + .setlease = simple_nosetlease, 255 255 };
+2
fs/ceph/dir.c
··· 2214 2214 .fsync = ceph_fsync, 2215 2215 .lock = ceph_lock, 2216 2216 .flock = ceph_flock, 2217 + .setlease = simple_nosetlease, 2217 2218 }; 2218 2219 2219 2220 const struct file_operations ceph_snapdir_fops = { ··· 2222 2221 .llseek = ceph_dir_llseek, 2223 2222 .open = ceph_open, 2224 2223 .release = ceph_release, 2224 + .setlease = simple_nosetlease, 2225 2225 }; 2226 2226 2227 2227 const struct inode_operations ceph_dir_iops = {
+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
+1
fs/nfs/dir.c
··· 66 66 .open = nfs_opendir, 67 67 .release = nfs_closedir, 68 68 .fsync = nfs_fsync_dir, 69 + .setlease = simple_nosetlease, 69 70 }; 70 71 71 72 const struct address_space_operations nfs_dir_aops = {
-2
fs/nfs/nfs4file.c
··· 431 431 static int nfs4_setlease(struct file *file, int arg, struct file_lease **lease, 432 432 void **priv) 433 433 { 434 - if (!S_ISREG(file_inode(file)->i_mode)) 435 - return -EINVAL; 436 434 return nfs4_proc_setlease(file, arg, lease, priv); 437 435 } 438 436
+1 -3
fs/smb/client/cifsfs.c
··· 1149 1149 struct inode *inode = file_inode(file); 1150 1150 struct cifsFileInfo *cfile = file->private_data; 1151 1151 1152 - if (!S_ISREG(inode->i_mode)) 1153 - return -EINVAL; 1154 - 1155 1152 /* Check if file is oplocked if this is request for new lease */ 1156 1153 if (arg == F_UNLCK || 1157 1154 ((arg == F_RDLCK) && CIFS_CACHE_READ(CIFS_I(inode))) || ··· 1709 1712 .remap_file_range = cifs_remap_file_range, 1710 1713 .llseek = generic_file_llseek, 1711 1714 .fsync = cifs_dir_fsync, 1715 + .setlease = simple_nosetlease, 1712 1716 }; 1713 1717 1714 1718 static void
+1
fs/vboxsf/dir.c
··· 186 186 .release = vboxsf_dir_release, 187 187 .read = generic_read_dir, 188 188 .llseek = generic_file_llseek, 189 + .setlease = simple_nosetlease, 189 190 }; 190 191 191 192 /*