Unionfs: use locking around i_size_write in 32-bit systems
authorErez Zadok <ezk@cs.sunysb.edu>
Tue, 25 Dec 2007 21:50:44 +0000 (16:50 -0500)
committerErez Zadok <ezk@cs.sunysb.edu>
Sun, 23 Mar 2008 03:44:33 +0000 (23:44 -0400)
CC: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
fs/unionfs/super.c

index 37fdc290cf491522304a05d07d54dc497308f515..d1049fbb16d488c5ad424629a8d6069c9d895dd7 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);