From: Andrew Morton mm-only debug patch... Cc: Michael Halcrow Cc: Miklos Szeredi Signed-off-by: Andrew Morton --- fs/attr.c | 2 ++ 1 file changed, 2 insertions(+) diff -puN fs/attr.c~notify_change-callers-must-hold-i_mutex fs/attr.c --- a/fs/attr.c~notify_change-callers-must-hold-i_mutex +++ a/fs/attr.c @@ -108,6 +108,8 @@ int notify_change(struct dentry * dentry struct timespec now; unsigned int ia_valid = attr->ia_valid; + WARN_ON_ONCE(!mutex_is_locked(&inode->i_mutex)); + now = current_fs_time(inode->i_sb); attr->ia_ctime = now; _