Re: [PATCH 08/10] fsnotify: use path_clone()
From: Jan Kara
Date: Mon Sep 14 2026 - 04:44:07 EST
On Sun 13-09-26 16:49:15, Mateusz Guzik wrote:
> No functional changes.
>
> Signed-off-by: Mateusz Guzik <mjguzik@xxxxxxxxx>
This looks good to me. Feel free to add:
Reviewed-by: Jan Kara <jack@xxxxxxx>
Honza
> ---
> fs/notify/fanotify/fanotify.c | 6 ++----
> 1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotify.c
> index a208a7ec1692..84b4c505dbe3 100644
> --- a/fs/notify/fanotify/fanotify.c
> +++ b/fs/notify/fanotify/fanotify.c
> @@ -559,9 +559,8 @@ static struct fanotify_event *fanotify_alloc_path_event(const struct path *path,
> return NULL;
>
> pevent->fae.type = FANOTIFY_EVENT_TYPE_PATH;
> - pevent->path = *path;
> *hash ^= fanotify_hash_path(path);
> - path_get(path);
> + path_clone(path, &pevent->path);
>
> return &pevent->fae;
> }
> @@ -600,10 +599,9 @@ static struct fanotify_event *fanotify_alloc_perm_event(const void *data,
> pevent->hdr.len = 0;
> pevent->state = FAN_EVENT_INIT;
> pevent->watchdog_cnt = 0;
> - pevent->path = *path;
> pevent->pos = range ? range->pos : FANOTIFY_NO_RANGE;
> pevent->count = range ? range->count : 0;
> - path_get(path);
> + path_clone(path, &pevent->path);
>
> return &pevent->fae;
> }
> --
> 2.53.0
>
--
Jan Kara <jack@xxxxxxxx>
SUSE Labs, CR