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.