Unionfs: use locking around i_size_write in 32-bit systems
authorErez Zadok <ezk@cs.sunysb.edu>
Thu, 10 Jan 2008 11:51:29 +0000 (06:51 -0500)
committerRachita Kothiyal <rachita@dewey.fsl.cs.sunysb.edu>
Thu, 1 May 2008 23:03:28 +0000 (19:03 -0400)
CC: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/super.c

index 5959d17e0df906ffe4e7afd182ce1c8abf49cd77..6f90070ba89c0b068bfd00afb757ca3758339eb6 100644 (file)
@@ -67,7 +67,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);