Unionfs: use locking around i_size_write in 32-bit systems
authorErez Zadok <ezk@cs.sunysb.edu>
Fri, 21 Dec 2007 05:27:47 +0000 (00:27 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Wed, 6 Jan 2010 03:44:11 +0000 (22:44 -0500)
CC: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/super.c

index 0ff9a9e7eeaf914c8c82c644cbcb3f5d6019624e..ed3eb0460feba4d3bf941c58713f03d0ebcb2c1b 100644 (file)
@@ -69,7 +69,13 @@ static void unionfs_read_inode(struct inode *inode)
  */
 static void unionfs_delete_inode(struct inode *inode)
 {
+#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
+       spin_lock(&inode->i_lock);
+#endif
        i_size_write(inode, 0); /* every f/s seems to do that */
+#if BITS_PER_LONG == 32 && defined(CONFIG_SMP)
+       spin_unlock(&inode->i_lock);
+#endif
 
        if (inode->i_data.nrpages)
                truncate_inode_pages(&inode->i_data, 0);