From 22e7478ddbcb670e33fab72d0bbe7c394c3a2c84 Mon Sep 17 00:00:00 2001 From: Jeff Mahoney Date: Wed, 21 May 2014 13:28:07 -0400 Subject: [PATCH] reiserfs: call truncate_setsize under tailpack mutex Prior to commit 0e4f6a791b1e (Fix reiserfs_file_release()), reiserfs truncates serialized on i_mutex. They mostly still do, with the exception of reiserfs_file_release. That blocks out other writers via the tailpack mutex and the inode openers counter adjusted in reiserfs_file_open. However, NFS will call reiserfs_setattr without having called ->open, so we end up with a race when nfs is calling ->setattr while another process is releasing the file. Ultimately, it triggers the BUG_ON(inode->i_size != new_file_size) check in maybe_indirect_to_direct. The solution is to pull the lock into reiserfs_setattr to encompass the truncate_setsize call as well. Signed-off-by: Jeff Mahoney Cc: Signed-off-by: Jan Kara --- Reading git-format-patch failed