History

Merge tag 'fsnotify_for_v6.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull fsnotify reverts from Jan Kara: "Syzbot has found out that fsnotify HSM events generated on page fault can be generated while we already hold freeze protection for the filesystem (when you do buffered write from a buffer which is mmapped file on the same filesystem) which violates expectations for HSM events and could lead to deadlocks of HSM clients with filesystem freezing. Since it's quite late in the cycle we've decided to revert changes implementing HSM events on page fault for now and instead just generate one event for the whole range on mmap(2) so that HSM client can fetch the data at that moment" * tag 'fsnotify_for_v6.14-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: Revert "fanotify: disable readahead if we have pre-content watches" Revert "mm: don't allow huge faults for files with pre content watches" Revert "fsnotify: generate pre-content permission event on page fault" Revert "xfs: add pre-content fsnotify hook for DAX faults" Revert "ext4: add pre-content fsnotify hook for DAX faults" fsnotify: add pre-content hooks on mmap()

Linus Torvalds committed 1 year ago

Commit eb88e6b2 parents 3571e8b 252256e9 files · +24 −143Browse files

Showing the changes to include (2 of 9 files). Show all

Unified · Split

2 files
  1. include/linux/fsnotify.h +21 −0
  2. include/linux/mm.h +0 −1
include/linux/fsnotify.h+21−0
@@ -170,6 +170,21 @@ static inline int fsnotify_file_area_perm(struct file *file, int perm_mask, · 169 unmodified lines
170 return fsnotify_path(&file->f_path, FS_ACCESS_PERM);170 return fsnotify_path(&file->f_path, FS_ACCESS_PERM);
171}171}
172 172
173/*
174 * fsnotify_mmap_perm - permission hook before mmap of file range
175 */
176static inline int fsnotify_mmap_perm(struct file *file, int prot,
177 const loff_t off, size_t len)
178{
179 /*
180 * mmap() generates only pre-content events.
181 */
182 if (!file || likely(!FMODE_FSNOTIFY_HSM(file->f_mode)))
183 return 0;
184
185 return fsnotify_pre_content(&file->f_path, &off, len);
186}
187
173/*188/*
174 * fsnotify_truncate_perm - permission hook before file truncate189 * fsnotify_truncate_perm - permission hook before file truncate
175 */190 */
@@ -223,6 +238,12 @@ static inline int fsnotify_file_area_perm(struct file *file, int perm_mask, · 47 unmodified lines
223 return 0;238 return 0;
224}239}
225 240
241static inline int fsnotify_mmap_perm(struct file *file, int prot,
242 const loff_t off, size_t len)
243{
244 return 0;
245}
246
226static inline int fsnotify_truncate_perm(const struct path *path, loff_t length)247static inline int fsnotify_truncate_perm(const struct path *path, loff_t length)
227{248{
228 return 0;249 return 0;
include/linux/mm.h+0−1
@@ -3420,7 +3420,6 @@ extern vm_fault_t filemap_fault(struct vm_fault *vmf); · 3419 unmodified lines
3420extern vm_fault_t filemap_map_pages(struct vm_fault *vmf,3420extern vm_fault_t filemap_map_pages(struct vm_fault *vmf,
3421 pgoff_t start_pgoff, pgoff_t end_pgoff);3421 pgoff_t start_pgoff, pgoff_t end_pgoff);
3422extern vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf);3422extern vm_fault_t filemap_page_mkwrite(struct vm_fault *vmf);
3423extern vm_fault_t filemap_fsnotify_fault(struct vm_fault *vmf);
3424 3423
3425extern unsigned long stack_guard_gap;3424extern unsigned long stack_guard_gap;
3426/* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */3425/* Generic expand stack which grows the stack according to GROWS{UP,DOWN} */