mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christian Brauner <brauner@kernel.org>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Christian Brauner <brauner@kernel.org>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [GIT PULL 04/12 for v7.0] vfs leases
Date: Fri,  6 Feb 2026 17:50:00 +0100	[thread overview]
Message-ID: <20260206-vfs-leases-v70-bff7da8bfd23@brauner> (raw)
In-Reply-To: <20260206-vfs-v70-7df0b750d594@brauner>

Hey Linus,

/* Summary */

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
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 series 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.

/* Testing */

gcc (Debian 14.2.0-19) 14.2.0
Debian clang version 19.1.7 (3+b1)

No build failures or warnings were observed.

/* Conflicts */

Merge conflicts with mainline
=============================

No known conflicts.

Merge conflicts with other trees
================================

diff --cc Documentation/filesystems/porting.rst
index ed3ac56e3c76,2b4dddfe6c66..000000000000
--- a/Documentation/filesystems/porting.rst
+++ b/Documentation/filesystems/porting.rst
@@@ -1336,7 -1339,6 +1336,15 @@@ in-tree filesystems have done)

 **mandatory**

+The ->setlease() file_operation must now be explicitly set in order to provide
+support for leases. When set to NULL, the kernel will now return -EINVAL to
+attempts to set a lease. Filesystems that wish to use the kernel-internal lease
+implementation should set it to generic_setlease().
++
++---
++
++**mandatory**
++
+ do_{mkdir,mknod,link,symlink,renameat2,rmdir,unlink}() are gone; filename_...()
+ counterparts replace those.  The difference is that the former used to consume
+ filename references; the latter do not.

[1]: https://lore.kernel.org/linux-next/20260115093828.318572ea@canb.auug.org.au/
[2]: https://lore.kernel.org/linux-next/aW41jU88O4Hfnt9i@sirena.org.uk/

The following changes since commit 7d42f2b1cc3a60a71784967384ddcf29fe3f35ed:

  Merge patch series "vfs: properly deny directory leases on filesystems with special lease handling" (2026-01-12 10:54:52 +0100)

are available in the Git repository at:

  git@gitolite.kernel.org:pub/scm/linux/kernel/git/vfs/vfs tags/vfs-7.0-rc1.leases

for you to fetch changes up to 056a96e65f3e2a3293b99a336de92376407af5fa:

  fuse: add setlease file operation (2026-01-13 09:56:11 +0100)

----------------------------------------------------------------
vfs-7.0-rc1.leases

Please consider pulling these changes from the signed vfs-7.0-rc1.leases tag.

Thanks!
Christian

----------------------------------------------------------------
Christian Brauner (1):
      Merge patch series "vfs: require filesystems to explicitly opt-in to lease support"

Jeff Layton (25):
      fs: add setlease to generic_ro_fops and read-only filesystem directory operations
      affs: add setlease file operation
      btrfs: add setlease file operation
      erofs: add setlease file operation
      ext2: add setlease file operation
      ext4: add setlease file operation
      exfat: add setlease file operation
      f2fs: add setlease file operation
      fat: add setlease file operation
      gfs2: add a setlease file operation
      jffs2: add setlease file operation
      jfs: add setlease file operation
      nilfs2: add setlease file operation
      ntfs3: add setlease file operation
      ocfs2: add setlease file operation
      orangefs: add setlease file operation
      overlayfs: add setlease file operation
      squashfs: add setlease file operation
      tmpfs: add setlease file operation
      udf: add setlease file operation
      ufs: add setlease file operation
      xfs: add setlease file operation
      filelock: default to returning -EINVAL when ->setlease operation is NULL
      fs: remove simple_nosetlease()
      fuse: add setlease file operation

 Documentation/filesystems/porting.rst |  9 +++++++++
 Documentation/filesystems/vfs.rst     |  9 ++++++---
 fs/9p/vfs_dir.c                       |  2 --
 fs/9p/vfs_file.c                      |  2 --
 fs/affs/dir.c                         |  2 ++
 fs/affs/file.c                        |  2 ++
 fs/befs/linuxvfs.c                    |  2 ++
 fs/btrfs/file.c                       |  2 ++
 fs/btrfs/inode.c                      |  2 ++
 fs/ceph/dir.c                         |  2 --
 fs/ceph/file.c                        |  1 -
 fs/cramfs/inode.c                     |  2 ++
 fs/efs/dir.c                          |  2 ++
 fs/erofs/data.c                       |  2 ++
 fs/erofs/dir.c                        |  2 ++
 fs/exfat/dir.c                        |  2 ++
 fs/exfat/file.c                       |  2 ++
 fs/ext2/dir.c                         |  2 ++
 fs/ext2/file.c                        |  2 ++
 fs/ext4/dir.c                         |  2 ++
 fs/ext4/file.c                        |  2 ++
 fs/f2fs/dir.c                         |  2 ++
 fs/f2fs/file.c                        |  2 ++
 fs/fat/dir.c                          |  2 ++
 fs/fat/file.c                         |  2 ++
 fs/freevxfs/vxfs_lookup.c             |  2 ++
 fs/fuse/dir.c                         |  1 -
 fs/fuse/file.c                        |  1 +
 fs/gfs2/file.c                        |  3 +--
 fs/isofs/dir.c                        |  2 ++
 fs/jffs2/dir.c                        |  2 ++
 fs/jffs2/file.c                       |  2 ++
 fs/jfs/file.c                         |  2 ++
 fs/jfs/namei.c                        |  2 ++
 fs/libfs.c                            | 20 ++------------------
 fs/locks.c                            |  3 +--
 fs/nfs/dir.c                          |  1 -
 fs/nfs/file.c                         |  1 -
 fs/nilfs2/dir.c                       |  3 ++-
 fs/nilfs2/file.c                      |  2 ++
 fs/ntfs3/dir.c                        |  3 +++
 fs/ntfs3/file.c                       |  3 +++
 fs/ocfs2/file.c                       |  5 +++++
 fs/orangefs/dir.c                     |  4 +++-
 fs/orangefs/file.c                    |  1 +
 fs/overlayfs/file.c                   |  2 ++
 fs/overlayfs/readdir.c                |  2 ++
 fs/qnx4/dir.c                         |  2 ++
 fs/qnx6/dir.c                         |  2 ++
 fs/read_write.c                       |  2 ++
 fs/smb/client/cifsfs.c                |  1 -
 fs/squashfs/dir.c                     |  2 ++
 fs/squashfs/file.c                    |  4 +++-
 fs/udf/dir.c                          |  2 ++
 fs/udf/file.c                         |  2 ++
 fs/ufs/dir.c                          |  2 ++
 fs/ufs/file.c                         |  2 ++
 fs/vboxsf/dir.c                       |  1 -
 fs/vboxsf/file.c                      |  1 -
 fs/xfs/xfs_file.c                     |  3 +++
 include/linux/fs.h                    |  1 -
 mm/shmem.c                            |  2 ++
 62 files changed, 117 insertions(+), 42 deletions(-)

  parent reply	other threads:[~2026-02-06 16:51 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 16:49 [GIT PULL 00/12 for v7.0] v7.0 Christian Brauner
2026-02-06 16:49 ` [GIT PULL 01/12 for v7.0] vfs rust Christian Brauner
2026-02-10  0:50   ` pr-tracker-bot
2026-02-06 16:49 ` [GIT PULL 02/12 for v7.0] vfs initrd Christian Brauner
2026-02-10  0:50   ` pr-tracker-bot
2026-02-06 16:49 ` [GIT PULL 03/12 for v7.0] vfs nonblocking_timestamps Christian Brauner
2026-02-10  0:50   ` pr-tracker-bot
2026-02-06 16:50 ` Christian Brauner [this message]
2026-02-10  0:50   ` [GIT PULL 04/12 for v7.0] vfs leases pr-tracker-bot
2026-02-06 16:50 ` [GIT PULL 05/12 for v7.0] vfs fserror Christian Brauner
2026-02-10  0:50   ` pr-tracker-bot
2026-02-06 16:50 ` [GIT PULL 06/12 for v7.0] vfs btrfs Christian Brauner
2026-02-10  0:50   ` pr-tracker-bot
2026-02-06 16:50 ` [GIT PULL 07/12 for v7.0] vfs minix Christian Brauner
2026-02-10  0:50   ` pr-tracker-bot
2026-02-06 16:50 ` [GIT PULL 08/12 for v7.0] vfs nullfs Christian Brauner
2026-02-10  0:50   ` pr-tracker-bot
2026-02-06 16:50 ` [GIT PULL 09/12 for v7.0] vfs atomic_open Christian Brauner
2026-02-10  0:50   ` pr-tracker-bot
2026-02-06 16:50 ` [GIT PULL 10/12 for v7.0] vfs namespace Christian Brauner
2026-02-10  0:50   ` pr-tracker-bot
2026-02-06 16:50 ` [GIT PULL 11/12 for v7.0] vfs iomap Christian Brauner
2026-02-10  0:50   ` pr-tracker-bot
2026-02-06 16:50 ` [GIT PULL 12/12 for v7.0] vfs misc Christian Brauner
2026-02-07  5:11   ` Nathan Chancellor
2026-02-09  9:31     ` Christian Brauner
2026-02-10  0:50   ` pr-tracker-bot
2026-02-16 12:29 ` [GIT PULL 13/12 for v7.0] kernel misc Christian Brauner
2026-02-16 22:11   ` pr-tracker-bot
2026-02-16 12:55 ` [GIT PULL 14/12 for v7.0] vfs misc 2 Christian Brauner
2026-02-16 22:11   ` pr-tracker-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260206-vfs-leases-v70-bff7da8bfd23@brauner \
    --to=brauner@kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®