patch-2.3.47 linux/fs/nfs/inode.c

Next file: linux/fs/nfsd/lockd.c
Previous file: linux/fs/nfs/file.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.46/linux/fs/nfs/inode.c linux/fs/nfs/inode.c
@@ -28,6 +28,7 @@
 #include <linux/sunrpc/stats.h>
 #include <linux/nfs_fs.h>
 #include <linux/lockd/bind.h>
+#include <linux/smp_lock.h>
 
 #include <asm/system.h>
 #include <asm/uaccess.h>
@@ -102,6 +103,7 @@
 
 	dprintk("NFS: delete_inode(%x/%ld)\n", inode->i_dev, inode->i_ino);
 
+	lock_kernel();
 	if (S_ISDIR(inode->i_mode)) {
 		nfs_free_dircache(inode);
 	} else {
@@ -129,6 +131,8 @@
 	if (failed)
 		printk("NFS: inode %ld had %d failed requests\n",
 			inode->i_ino, failed);
+	unlock_kernel();
+
 	clear_inode(inode);
 }
 
@@ -683,14 +687,12 @@
 		if (attr->ia_size != fattr.size)
 			printk("nfs_notify_change: attr=%Ld, fattr=%d??\n",
 			       (long long) attr->ia_size, fattr.size);
-		inode->i_size  = attr->ia_size;
 		inode->i_mtime = fattr.mtime.seconds;
+		vmtruncate(inode, attr->ia_size);
 	}
 	if (attr->ia_valid & ATTR_MTIME)
 		inode->i_mtime = fattr.mtime.seconds;
 	error = nfs_refresh_inode(inode, &fattr);
-	if (!error && (attr->ia_valid & ATTR_SIZE))
-		vmtruncate(inode, attr->ia_size);
 out:
 	return error;
 }

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)