Skip to content

Commit 1675960

Browse files
committed
Merge: fsnotify: update to upstream (v6.7)
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/7097 JIRA: https://issues.redhat.com/browse/RHEL-102134 Update fsnotify/fanotify/inotify patches. Exclude pidfd support. Signed-off-by: Miklos Szeredi <mszeredi@redhat.com> Approved-by: David Howells <dhowells@redhat.com> Approved-by: Ian Kent <ikent@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: Augusto Caringi <acaringi@redhat.com>
2 parents d6a10bb + e908619 commit 1675960

File tree

22 files changed

+1592
-529
lines changed

22 files changed

+1592
-529
lines changed

fs/nfsd/filecache.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -766,7 +766,8 @@ nfsd_file_cache_init(void)
766766
goto out_shrinker;
767767
}
768768

769-
nfsd_file_fsnotify_group = fsnotify_alloc_group(&nfsd_file_fsnotify_ops);
769+
nfsd_file_fsnotify_group = fsnotify_alloc_group(&nfsd_file_fsnotify_ops,
770+
0);
770771
if (IS_ERR(nfsd_file_fsnotify_group)) {
771772
pr_err("nfsd: unable to create fsnotify group: %ld\n",
772773
PTR_ERR(nfsd_file_fsnotify_group));

fs/notify/dnotify/dnotify.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void dnotify_flush(struct file *filp, fl_owner_t id)
168168
return;
169169
dn_mark = container_of(fsn_mark, struct dnotify_mark, fsn_mark);
170170

171-
mutex_lock(&dnotify_group->mark_mutex);
171+
fsnotify_group_lock(dnotify_group);
172172

173173
spin_lock(&fsn_mark->lock);
174174
prev = &dn_mark->dn;
@@ -191,15 +191,15 @@ void dnotify_flush(struct file *filp, fl_owner_t id)
191191
free = true;
192192
}
193193

194-
mutex_unlock(&dnotify_group->mark_mutex);
194+
fsnotify_group_unlock(dnotify_group);
195195

196196
if (free)
197197
fsnotify_free_mark(fsn_mark);
198198
fsnotify_put_mark(fsn_mark);
199199
}
200200

201201
/* this conversion is done only at watch creation */
202-
static __u32 convert_arg(unsigned long arg)
202+
static __u32 convert_arg(unsigned int arg)
203203
{
204204
__u32 new_mask = FS_EVENT_ON_CHILD;
205205

@@ -214,7 +214,7 @@ static __u32 convert_arg(unsigned long arg)
214214
if (arg & DN_ATTRIB)
215215
new_mask |= FS_ATTRIB;
216216
if (arg & DN_RENAME)
217-
new_mask |= FS_DN_RENAME;
217+
new_mask |= FS_RENAME;
218218
if (arg & DN_CREATE)
219219
new_mask |= (FS_CREATE | FS_MOVED_TO);
220220

@@ -258,7 +258,7 @@ static int attach_dn(struct dnotify_struct *dn, struct dnotify_mark *dn_mark,
258258
* up here. Allocate both a mark for fsnotify to add and a dnotify_struct to be
259259
* attached to the fsnotify_mark.
260260
*/
261-
int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
261+
int fcntl_dirnotify(int fd, struct file *filp, unsigned int arg)
262262
{
263263
struct dnotify_mark *new_dn_mark, *dn_mark;
264264
struct fsnotify_mark *new_fsn_mark, *fsn_mark;
@@ -324,7 +324,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
324324
new_dn_mark->dn = NULL;
325325

326326
/* this is needed to prevent the fcntl/close race described below */
327-
mutex_lock(&dnotify_group->mark_mutex);
327+
fsnotify_group_lock(dnotify_group);
328328

329329
/* add the new_fsn_mark or find an old one. */
330330
fsn_mark = fsnotify_find_mark(&inode->i_fsnotify_marks, dnotify_group);
@@ -334,7 +334,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
334334
} else {
335335
error = fsnotify_add_inode_mark_locked(new_fsn_mark, inode, 0);
336336
if (error) {
337-
mutex_unlock(&dnotify_group->mark_mutex);
337+
fsnotify_group_unlock(dnotify_group);
338338
goto out_err;
339339
}
340340
spin_lock(&new_fsn_mark->lock);
@@ -383,7 +383,7 @@ int fcntl_dirnotify(int fd, struct file *filp, unsigned long arg)
383383

384384
if (destroy)
385385
fsnotify_detach_mark(fsn_mark);
386-
mutex_unlock(&dnotify_group->mark_mutex);
386+
fsnotify_group_unlock(dnotify_group);
387387
if (destroy)
388388
fsnotify_free_mark(fsn_mark);
389389
fsnotify_put_mark(fsn_mark);
@@ -401,7 +401,8 @@ static int __init dnotify_init(void)
401401
SLAB_PANIC|SLAB_ACCOUNT);
402402
dnotify_mark_cache = KMEM_CACHE(dnotify_mark, SLAB_PANIC|SLAB_ACCOUNT);
403403

404-
dnotify_group = fsnotify_alloc_group(&dnotify_fsnotify_ops);
404+
dnotify_group = fsnotify_alloc_group(&dnotify_fsnotify_ops,
405+
FSNOTIFY_GROUP_NOFS);
405406
if (IS_ERR(dnotify_group))
406407
panic("unable to allocate fsnotify group for dnotify\n");
407408
dnotify_sysctl_init();

0 commit comments

Comments
 (0)