Merge branches 'misc', 'eeepc-laptop' and 'bugzilla-14445' into release
[safe/jmp/linux-2.6] / fs / notify / inode_mark.c
index 0a499d2..3165d85 100644 (file)
@@ -190,7 +190,8 @@ void fsnotify_destroy_mark_by_entry(struct fsnotify_mark_entry *entry)
         * callback to the group function to let it know that this entry
         * is being freed.
         */
-       group->ops->freeing_mark(entry, group);
+       if (group->ops->freeing_mark)
+               group->ops->freeing_mark(entry, group);
 
        /*
         * __fsnotify_update_child_dentry_flags(inode);
@@ -323,11 +324,11 @@ int fsnotify_add_mark(struct fsnotify_mark_entry *entry,
        spin_lock(&group->mark_lock);
        spin_lock(&inode->i_lock);
 
-       entry->group = group;
-       entry->inode = inode;
-
        lentry = fsnotify_find_mark_entry(group, inode);
        if (!lentry) {
+               entry->group = group;
+               entry->inode = inode;
+
                hlist_add_head(&entry->i_list, &inode->i_fsnotify_mark_entries);
                list_add(&entry->g_list, &group->mark_entries);