Re: [PATCH v5 10/17] fanotify: cache fsid in fsnotify_mark_connector

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

 



On Thu, Feb 7, 2019 at 4:48 PM Jan Kara <jack@xxxxxxx> wrote:
>
> On Thu 10-01-19 19:04:37, Amir Goldstein wrote:
> > For FAN_REPORT_FID, we need to encode fid with fsid of the filesystem on
> > every event. To avoid having to call vfs_statfs() on every event to get
> > fsid, we store the fsid in fsnotify_mark_connector on the first time we
> > add a mark and on handle event we use the cached fsid.
> >
> > Subsequent calls to add mark on the same object are expected to pass the
> > same fsid, so the call will fail on cached fsid mismatch.
> >
> > If an event is reported on several mark types (inode, mount, filesystem),
> > all connectors should already have the same fsid, so we use the cached
> > fsid from the first connector.
> >
> > Suggested-by: Jan Kara <jack@xxxxxxx>
> > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx>
>
> I've somewhat modified the patch to simplify code flow around
> fanotify_get_fid() and also made fsid argument for
> fsnotify_add_mark_locked() mandatory. The resulting patch is attached.
>

ACK. Two nits.

1. Dan Carpenter reported a smatch warning. Please fix:

fs/notify/fanotify/fanotify.c:194 fanotify_encode_fid() error:
uninitialized symbol 'type'.
fs/notify/fanotify/fanotify.c:194 fanotify_encode_fid() error:
uninitialized symbol 'err'.

2. checkpatch doesn't like cutting long debug strings into 80 chars
(and Greg's linuxsty.vim plugin doesn't warn about them)
referring to the long string that you broke up
pr_warn_ratelimited("%s: fsid mismatch on object of type %u: "...

Thanks,
Amir.



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux