diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-09 11:59:07 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-09 11:59:07 -0800 |
| commit | aa2a0fcd4c7b9801be32482755a450a80a3c36a2 (patch) | |
| tree | 90efeda7d2b84c3d32609d8001a2a90063e5b688 /fs/fat | |
| parent | 74554251dfc9374ebf1a9dfc54d6745d56bb9265 (diff) | |
| parent | 056a96e65f3e2a3293b99a336de92376407af5fa (diff) | |
Merge tag 'vfs-7.0-rc1.leases' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs
Pull vfs lease updates from Christian Brauner:
"This contains updates for lease support to require filesystems to
explicitly opt-in to lease support
Currently kernel_setlease() falls through to generic_setlease() when a
a filesystem does not define ->setlease(), silently granting lease
support to every filesystem regardless of whether it is prepared for
it.
This is a poor default: most filesystems never intended to support
leases, and the silent fallthrough makes it impossible to distinguish
"supports leases" from "never thought about it".
This inverts the default. It adds explicit
.setlease = generic_setlease;
assignments to every in-tree filesystem that should retain lease
support, then changes kernel_setlease() to return -EINVAL when
->setlease is NULL.
With the new default in place, simple_nosetlease() is redundant and
is removed along with all references to it"
* tag 'vfs-7.0-rc1.leases' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs: (25 commits)
fuse: add setlease file operation
fs: remove simple_nosetlease()
filelock: default to returning -EINVAL when ->setlease operation is NULL
xfs: add setlease file operation
ufs: add setlease file operation
udf: add setlease file operation
tmpfs: add setlease file operation
squashfs: add setlease file operation
overlayfs: add setlease file operation
orangefs: add setlease file operation
ocfs2: add setlease file operation
ntfs3: add setlease file operation
nilfs2: add setlease file operation
jfs: add setlease file operation
jffs2: add setlease file operation
gfs2: add a setlease file operation
fat: add setlease file operation
f2fs: add setlease file operation
exfat: add setlease file operation
ext4: add setlease file operation
...
Diffstat (limited to 'fs/fat')
| -rw-r--r-- | fs/fat/dir.c | 2 | ||||
| -rw-r--r-- | fs/fat/file.c | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/fs/fat/dir.c b/fs/fat/dir.c index 3d03bff40944..0e97ef6c2327 100644 --- a/fs/fat/dir.c +++ b/fs/fat/dir.c @@ -16,6 +16,7 @@ #include <linux/slab.h> #include <linux/compat.h> +#include <linux/filelock.h> #include <linux/uaccess.h> #include <linux/iversion.h> #include "fat.h" @@ -876,6 +877,7 @@ const struct file_operations fat_dir_operations = { .compat_ioctl = fat_compat_dir_ioctl, #endif .fsync = fat_file_fsync, + .setlease = generic_setlease, }; static int fat_get_short_entry(struct inode *dir, loff_t *pos, diff --git a/fs/fat/file.c b/fs/fat/file.c index f9bc93411aa2..afc0e3ad6536 100644 --- a/fs/fat/file.c +++ b/fs/fat/file.c @@ -13,6 +13,7 @@ #include <linux/mount.h> #include <linux/blkdev.h> #include <linux/backing-dev.h> +#include <linux/filelock.h> #include <linux/fsnotify.h> #include <linux/security.h> #include <linux/falloc.h> @@ -212,6 +213,7 @@ const struct file_operations fat_file_operations = { .splice_read = filemap_splice_read, .splice_write = iter_file_splice_write, .fallocate = fat_fallocate, + .setlease = generic_setlease, }; static int fat_cont_expand(struct inode *inode, loff_t size) |
