diff options
author | Thomas Zimmermann <tzimmermann@suse.de> | 2025-02-18 09:43:43 +0300 |
---|---|---|
committer | Thomas Zimmermann <tzimmermann@suse.de> | 2025-02-18 09:43:43 +0300 |
commit | 8bd1a8e7572c1012b19e4f57e2f49451820167ef (patch) | |
tree | d3e324f78d3b3bb7cf244be9c09ee463afd0ff7e /fs/file_table.c | |
parent | b296955b3a740ecc8b3b08e34fd64f1ceabb8fb4 (diff) | |
parent | 0ed1356af8f629ae807963b7db4e501e3b580bc2 (diff) | |
download | linux-8bd1a8e7572c1012b19e4f57e2f49451820167ef.tar.xz |
Merge drm/drm-next into drm-misc-next
Backmerging to get bugfixes from v6.14-rc2.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Diffstat (limited to 'fs/file_table.c')
-rw-r--r-- | fs/file_table.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/fs/file_table.c b/fs/file_table.c index f0291a66f9db..5c00dc38558d 100644 --- a/fs/file_table.c +++ b/fs/file_table.c @@ -194,6 +194,11 @@ static int init_file(struct file *f, int flags, const struct cred *cred) * refcount bumps we should reinitialize the reused file first. */ file_ref_init(&f->f_ref, 1); + /* + * Disable permission and pre-content events for all files by default. + * They may be enabled later by file_set_fsnotify_mode_from_watchers(). + */ + file_set_fsnotify_mode(f, FMODE_NONOTIFY_PERM); return 0; } @@ -375,7 +380,13 @@ struct file *alloc_file_pseudo(struct inode *inode, struct vfsmount *mnt, if (IS_ERR(file)) { ihold(inode); path_put(&path); + return file; } + /* + * Disable all fsnotify events for pseudo files by default. + * They may be enabled by caller with file_set_fsnotify_mode(). + */ + file_set_fsnotify_mode(file, FMODE_NONOTIFY); return file; } EXPORT_SYMBOL(alloc_file_pseudo); @@ -400,6 +411,11 @@ struct file *alloc_file_pseudo_noaccount(struct inode *inode, return file; } file_init_path(file, &path, fops); + /* + * Disable all fsnotify events for pseudo files by default. + * They may be enabled by caller with file_set_fsnotify_mode(). + */ + file_set_fsnotify_mode(file, FMODE_NONOTIFY); return file; } EXPORT_SYMBOL_GPL(alloc_file_pseudo_noaccount); |