From: OGAWA Hirofumi Subject: Race inotify_rm_watch vs umount Date: Fri, 10 Jun 2011 20:20:55 +0900 Message-ID: <87r572nd9k.fsf@devron.myhome.or.jp> Mime-Version: 1.0 Content-Type: text/plain Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org To: John McCutchan , Robert Love , Eric Paris Return-path: Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Hi, I'm looking the race inotify_rm_watch() vs umount(). This race become the cause of Oops. You can see the oops at https://bugzilla.kernel.org/show_bug.cgi?id=22602 So, what race? umount inotify_rm_watch ... fsnotify_destroy_mark() fsnotify_destroy_inode_mark() /* removed from i_fsnotify_marks */ generic_shutdown_super() fsnotify_unmount_inodes() put_super() iput() iput_final() /* this is after put_super() */ Like above, inotify doesn't guarantee to call final iput() before put_super(). With this violation, FS driver can oops. Well, so, what are requested for inotify? We can't simply take sb->s_umount in inotify_rm_watch()? Any ideas? Thanks. -- OGAWA Hirofumi