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 tag 'fsnotify_for_v6.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull fsnotify fixes from Jan Kara:

- Stop-gap solution for a race between unmount of a filesystem with
fsnotify marks and someone inspecting fdinfo of fsnotify group with
those marks in procfs.

A proper solution is in the works but it will get a while to settle.

- Fix for non-decodable file handles (used by unprivileged apps using
fanotify)

* tag 'fsnotify_for_v6.18-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
fs/notify: call exportfs_encode_fid with s_umount
expfs: Fix exportfs_can_encode_fh() for EXPORT_FH_FID

+10 -3
+6
fs/notify/fdinfo.c
··· 17 17 #include "fanotify/fanotify.h" 18 18 #include "fdinfo.h" 19 19 #include "fsnotify.h" 20 + #include "../internal.h" 20 21 21 22 #if defined(CONFIG_PROC_FS) 22 23 ··· 47 46 48 47 size = f->handle_bytes >> 2; 49 48 49 + if (!super_trylock_shared(inode->i_sb)) 50 + return; 51 + 50 52 ret = exportfs_encode_fid(inode, (struct fid *)f->f_handle, &size); 53 + up_read(&inode->i_sb->s_umount); 54 + 51 55 if ((ret == FILEID_INVALID) || (ret < 0)) 52 56 return; 53 57
+4 -3
include/linux/exportfs.h
··· 320 320 static inline bool exportfs_can_encode_fh(const struct export_operations *nop, 321 321 int fh_flags) 322 322 { 323 - if (!nop) 324 - return false; 325 - 326 323 /* 327 324 * If a non-decodeable file handle was requested, we only need to make 328 325 * sure that filesystem did not opt-out of encoding fid. 329 326 */ 330 327 if (fh_flags & EXPORT_FH_FID) 331 328 return exportfs_can_encode_fid(nop); 329 + 330 + /* Normal file handles cannot be created without export ops */ 331 + if (!nop) 332 + return false; 332 333 333 334 /* 334 335 * If a connectable file handle was requested, we need to make sure that