patch-2.1.120 linux/fs/inode.c

Next file: linux/fs/isofs/inode.c
Previous file: linux/fs/hpfs/hpfs_fs.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.119/linux/fs/inode.c linux/fs/inode.c
@@ -770,7 +770,13 @@
 		inode = file->f_dentry->d_inode;
 		if (!inode || inode->i_sb != sb)
 			continue;
-		if (S_ISREG(inode->i_mode) && file->f_mode & FMODE_WRITE)
+
+		/* File with pending delete? */
+		if (inode->i_nlink == 0)
+			return 0;
+
+		/* Writable file? */
+		if (S_ISREG(inode->i_mode) && (file->f_mode & FMODE_WRITE))
 			return 0;
 	}
 	return 1; /* Tis' cool bro. */

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov