Re: Patch "fanotify: wire up FAN_RENAME event" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Mar 19, 2024 at 4:28 AM Amir Goldstein <amir73il@xxxxxxxxx> wrote:
>
> Sasha,
>
> Something is off.
> This is a new feature.
> Not sure how it got selected for stable and dragged a *lot* of infrastructure code changes with it.
> Can you explain why triggered this backports or is it just "AI"?

Hi Chuck,

Please follow up with update of man page fanotify_mark(2) after merge:

         FAN_RENAME (since Linux 5.17)

For the records, this commit is explicitly mentioned in test fanotify14:

        .tags = (const struct tst_tag[]) {
                {"linux-git", "ceaf69f8eadc"},
                {"linux-git", "8698e3bab4dd"},

Because we took the opportunity of new API flags to refine the semantics
of some legacy undefined behavior.

Since you backported both those commits, no further action item here.

Thanks,
Amir.


Thanks,
Amir

>
> On Tue, Mar 19, 2024, 1:11 AM Sasha Levin <sashal@xxxxxxxxxx> wrote:
>>
>> This is a note to let you know that I've just added the patch titled
>>
>>     fanotify: wire up FAN_RENAME event
>>
>> to the 5.15-stable tree which can be found at:
>>     http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary
>>
>> The filename of the patch is:
>>      fanotify-wire-up-fan_rename-event.patch
>> and it can be found in the queue-5.15 subdirectory.
>>
>> If you, or anyone else, feels it should not be added to the stable tree,
>> please let <stable@xxxxxxxxxxxxxxx> know about it.
>>
>>
>>
>> commit 58c8f6750464d1100ca1e4aff3dd61734e6e3938
>> Author: Amir Goldstein <amir73il@xxxxxxxxx>
>> Date:   Mon Nov 29 22:15:37 2021 +0200
>>
>>     fanotify: wire up FAN_RENAME event
>>
>>     [ Upstream commit 8cc3b1ccd930fe6971e1527f0c4f1bdc8cb56026 ]
>>
>>     FAN_RENAME is the successor of FAN_MOVED_FROM and FAN_MOVED_TO
>>     and can be used to get the old and new parent+name information in
>>     a single event.
>>
>>     FAN_MOVED_FROM and FAN_MOVED_TO are still supported for backward
>>     compatibility, but it makes little sense to use them together with
>>     FAN_RENAME in the same group.
>>
>>     FAN_RENAME uses special info type records to report the old and
>>     new parent+name, so reporting only old and new parent id is less
>>     useful and was not implemented.
>>     Therefore, FAN_REANAME requires a group with flag FAN_REPORT_NAME.
>>
>>     Link: https://lore.kernel.org/r/20211129201537.1932819-12-amir73il@xxxxxxxxx
>>     Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>
>>     Signed-off-by: Jan Kara <jack@xxxxxxx>
>>     Signed-off-by: Chuck Lever <chuck.lever@xxxxxxxxxx>
>>
>> diff --git a/fs/notify/fanotify/fanotify.c b/fs/notify/fanotify/fanotifyc
>> index 0da305b6f3e2f..985e995d2a398 100644
>> --- a/fs/notify/fanotify/fanotify.c
>> +++ b/fs/notify/fanotify/fanotify.c
>> @@ -930,7 +930,7 @@ static int fanotify_handle_event(struct fsnotify_group *group, u32 mask,
>>         BUILD_BUG_ON(FAN_FS_ERROR != FS_ERROR);
>>         BUILD_BUG_ON(FAN_RENAME != FS_RENAME);
>>
>> -       BUILD_BUG_ON(HWEIGHT32(ALL_FANOTIFY_EVENT_BITS) != 20);
>> +       BUILD_BUG_ON(HWEIGHT32(ALL_FANOTIFY_EVENT_BITS) != 21);
>>
>>         mask = fanotify_group_event_mask(group, iter_info, &match_mask,
>>                                          mask, data, data_type, dir);
>> diff --git a/fs/notify/fanotify/fanotify_user.c b/fs/notify/fanotify/fanotify_user.c
>> index b3ac2d877e1ee..ce84eb8443b10 100644
>> --- a/fs/notify/fanotify/fanotify_user.c
>> +++ b/fs/notify/fanotify/fanotify_user.c
>> @@ -1604,6 +1604,14 @@ static int do_fanotify_mark(int fanotify_fd, unsigned int flags, __u64 mask,
>>             (!fid_mode || mark_type == FAN_MARK_MOUNT))
>>                 goto fput_and_out;
>>
>> +       /*
>> +        * FAN_RENAME uses special info type records to report the old and
>> +        * new parent+name.  Reporting only old and new parent id is less
>> +        * useful and was not implemented.
>> +        */
>> +       if (mask & FAN_RENAME && !(fid_mode & FAN_REPORT_NAME))
>> +               goto fput_and_out;
>> +
>>         if (flags & FAN_MARK_FLUSH) {
>>                 ret = 0;
>>                 if (mark_type == FAN_MARK_MOUNT)
>> diff --git a/include/linux/fanotify.h b/include/linux/fanotify.h
>> index 376e050e6f384..3afdf339d53c9 100644
>> --- a/include/linux/fanotify.h
>> +++ b/include/linux/fanotify.h
>> @@ -82,7 +82,8 @@ extern struct ctl_table fanotify_table[]; /* for sysctl */
>>   * Directory entry modification events - reported only to directory
>>   * where entry is modified and not to a watching parent.
>>   */
>> -#define FANOTIFY_DIRENT_EVENTS (FAN_MOVE | FAN_CREATE | FAN_DELETE)
>> +#define FANOTIFY_DIRENT_EVENTS (FAN_MOVE | FAN_CREATE | FAN_DELETE | \
>> +                                FAN_RENAME)
>>
>>  /* Events that can be reported with event->fd */
>>  #define FANOTIFY_FD_EVENTS (FANOTIFY_PATH_EVENTS | FANOTIFY_PERM_EVENTS)





[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux