Commit 13d88ac5 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull vfs fanotify fsid updates from Christian Brauner:
 "This work is part of the plan to enable fanotify to serve as a drop-in
  replacement for inotify. While inotify is availabe on all filesystems,
  fanotify currently isn't.

  In order to support fanotify on all filesystems two things are needed:

   (1) all filesystems need to support AT_HANDLE_FID

   (2) all filesystems need to report a non-zero f_fsid

  This contains (1) and allows filesystems to encode non-decodable file
  handlers for fanotify without implementing any exportfs operations by
  encoding a file id of type FILEID_INO64_GEN from i_ino and
  i_generation.

  Filesystems that want to opt out of encoding non-decodable file ids
  for fanotify that don't support NFS export can do so by providing an
  empty export_operations struct.

  This also partially addresses (2) by generating f_fsid for simple
  filesystems as well as freevxfs. Remaining filesystems will be dealt
  with by separate patches.

  Finally, this contains the patch from the current exportfs maintainers
  which moves exportfs under vfs with Chuck, Jeff, and Amir as
  maintainers and vfs.git as tree"

* tag 'vfs-6.7.fsid' of git://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs:
  MAINTAINERS: create an entry for exportfs
  fs: fix build error with CONFIG_EXPORTFS=m or not defined
  freevxfs: derive f_fsid from bdev->bd_dev
  fs: report f_fsid from s_dev for "simple" filesystems
  exportfs: support encoding non-decodeable file handles by default
  exportfs: define FILEID_INO64_GEN* file handle types
  exportfs: make ->encode_fh() a mandatory method for NFS export
  exportfs: add helpers to check if filesystem can encode/decode file handles
parents 062cca89 4ad714df
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -122,12 +122,9 @@ are exportable by setting the s_export_op field in the struct
super_block.  This field must point to a "struct export_operations"
struct which has the following members:

  encode_fh (optional)
  encode_fh (mandatory)
    Takes a dentry and creates a filehandle fragment which may later be used
    to find or create a dentry for the same object.  The default
    implementation creates a filehandle fragment that encodes a 32bit inode
    and generation number for the inode encoded, and if necessary the
    same information for the parent.
    to find or create a dentry for the same object.

  fh_to_dentry (mandatory)
    Given a filehandle fragment, this should find the implied object and
+9 −0
Original line number Diff line number Diff line
@@ -1052,3 +1052,12 @@ kill_anon_super(), or kill_block_super() helpers.

Lock ordering has been changed so that s_umount ranks above open_mutex again.
All places where s_umount was taken under open_mutex have been fixed up.

---

**mandatory**

export_operations ->encode_fh() no longer has a default implementation to
encode FILEID_INO32_GEN* file handles.
Filesystems that used the default implementation may use the generic helper
generic_encode_ino32_fh() explicitly.
+12 −1
Original line number Diff line number Diff line
@@ -8156,6 +8156,18 @@ F: include/linux/fs_types.h
F:	include/uapi/linux/fs.h
F:	include/uapi/linux/openat2.h
FILESYSTEMS [EXPORTFS]
M:	Chuck Lever <chuck.lever@oracle.com>
M:	Jeff Layton <jlayton@kernel.org>
R:	Amir Goldstein <amir73il@gmail.com>
L:	linux-fsdevel@vger.kernel.org
L:	linux-nfs@vger.kernel.org
S:	Supported
F:	Documentation/filesystems/nfs/exporting.rst
F:	fs/exportfs/
F:	fs/fhandle.c
F:	include/linux/exportfs.h
FILESYSTEMS [IOMAP]
M:	Christian Brauner <brauner@kernel.org>
R:	Darrick J. Wong <djwong@kernel.org>
@@ -11548,7 +11560,6 @@ S: Supported
W:	http://nfs.sourceforge.net/
T:	git git://git.kernel.org/pub/scm/linux/kernel/git/cel/linux.git
F:	Documentation/filesystems/nfs/
F:	fs/exportfs/
F:	fs/lockd/
F:	fs/nfs_common/
F:	fs/nfsd/
+1 −0
Original line number Diff line number Diff line
@@ -568,6 +568,7 @@ static struct dentry *affs_fh_to_parent(struct super_block *sb, struct fid *fid,
}

const struct export_operations affs_export_ops = {
	.encode_fh = generic_encode_ino32_fh,
	.fh_to_dentry = affs_fh_to_dentry,
	.fh_to_parent = affs_fh_to_parent,
	.get_parent = affs_get_parent,
+1 −0
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ static const struct address_space_operations befs_symlink_aops = {
};

static const struct export_operations befs_export_operations = {
	.encode_fh	= generic_encode_ino32_fh,
	.fh_to_dentry	= befs_fh_to_dentry,
	.fh_to_parent	= befs_fh_to_parent,
	.get_parent	= befs_get_parent,
Loading