Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

Advertisement
[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Kernel v2.6.24 /fs/ext2/file.c

Filename:/fs/ext2/file.c
Lines Added:5
Lines Deleted:2
Also changed in: (Previous) 2.6.24-rc8  2.6.24-rc7  2.6.24-rc6  2.6.24-rc5  2.6.24-rc4  2.6.24-rc3 
(Following) 2.6.24-git16  2.6.24-git17  2.6.24-git18  2.6.24-git19  2.6.24-git20  2.6.24-git21 

Location
[  2.6.24
  [  fs
    [  ext2
       o  file.c

Patch

diff --git a/fs/ext2/file.c b/fs/ext2/file.c
index ab79612..c051798 100644
--- a/fs/ext2/file.c
+++ b/fs/ext2/file.c
@@ -30,8 +30,11 @@
  */
 static int ext2_release_file (struct inode * inode, struct file * filp)
 {
-   if (filp->f_mode & FMODE_WRITE)
-      ext2_discard_prealloc (inode);
+   if (filp->f_mode & FMODE_WRITE) {
+      mutex_lock(&EXT2_I(inode)->truncate_mutex);
+      ext2_discard_reservation(inode);
+      mutex_unlock(&EXT2_I(inode)->truncate_mutex);
+   }
    return 0;
 }
 


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.