Hi! I was going through some old email and noticed this question. Probably you've already figured out yourself but just in case: On Tue 02-04-24 20:27:03, Josh Marshall wrote: > I am making an event driven free space monitoring utility. The core > idea of the design is to use fanotify to listen for the existence of > events which can increase space consumption, and when this happens > check the remaining free space. Extra functionality to make this not > face meltingly stupid are planned before I suggest anyone use it, > don't worry. > > I am using the documentation here: > https://man7.org/linux/man-pages/man7/fanotify.7.html > https://man7.org/linux/man-pages/man2/fanotify_init.2.html > https://man7.org/linux/man-pages/man2/fanotify_mark.2.html > > ```Causes problem > int f_notify = fanotify_init(FAN_CLASS_NOTIF, 0); > ``` > ```No problem > int f_notify = fanotify_init(FAN_CLASS_NOTIF | FAN_REPORT_DFID_NAME, 0); > ``` > ```Where it manifests > if( fanotify_mark(f_notify, FAN_MARK_ADD | FAN_MARK_ONLYDIR, > FAN_CREATE , AT_FDCWD, mnt) == -1 ){...} > ``` FAN_CREATE event is so called directory event and as such it requires the notification group to be in "FID mode" - i.e., reporting fsid + fhandle instead of open file descriptor to file generating the event. So you need at least FAN_REPORT_FID flag to fanotify_init(2) to be able to use FAN_CREATE event. Honza -- Jan Kara <jack@xxxxxxxx> SUSE Labs, CR