--- zzzz-none-000/linux-2.6.39.4/fs/notify/inotify/inotify_user.c 2011-08-03 19:43:28.000000000 +0000 +++ puma6-arm-6490-729/linux-2.6.39.4/fs/notify/inotify/inotify_user.c 2021-11-10 13:23:10.000000000 +0000 @@ -97,7 +97,8 @@ mask = (FS_IN_IGNORED | FS_EVENT_ON_CHILD | FS_UNMOUNT); /* mask off the flags used to open the fd */ - mask |= (arg & (IN_ALL_EVENTS | IN_ONESHOT | IN_EXCL_UNLINK)); + mask |= (arg & + (IN_ALL_EVENTS | IN_ONESHOT | IN_EXCL_UNLINK | IN_RECURSIVE)); return mask; } @@ -517,7 +518,6 @@ struct fsnotify_event *ignored_event, *notify_event; struct inotify_event_private_data *event_priv; struct fsnotify_event_private_data *fsn_event_priv; - int ret; ignored_event = fsnotify_create_event(NULL, FS_IN_IGNORED, NULL, FSNOTIFY_EVENT_NONE, NULL, 0, @@ -538,9 +538,7 @@ notify_event = fsnotify_add_notify_event(group, ignored_event, fsn_event_priv, NULL); if (notify_event) { - if (IS_ERR(notify_event)) - ret = PTR_ERR(notify_event); - else + if (!IS_ERR(notify_event)) fsnotify_put_event(notify_event); inotify_free_event_priv(fsn_event_priv); } @@ -852,8 +850,13 @@ BUILD_BUG_ON(IN_EXCL_UNLINK != FS_EXCL_UNLINK); BUILD_BUG_ON(IN_ISDIR != FS_ISDIR); BUILD_BUG_ON(IN_ONESHOT != FS_IN_ONESHOT); + BUILD_BUG_ON(IN_RECURSIVE != FS_EVENT_ON_CHILD_RECURSIVLY); +#if defined(CONFIG_FSNOTIFY_RECURSIVE) + BUG_ON(hweight32(ALL_INOTIFY_BITS) != 22); +#else BUG_ON(hweight32(ALL_INOTIFY_BITS) != 21); +#endif inotify_inode_mark_cachep = KMEM_CACHE(inotify_inode_mark, SLAB_PANIC); event_priv_cachep = KMEM_CACHE(inotify_event_private_data, SLAB_PANIC);