[PVFS2-CVS] commit by neill in pvfs2-1/src/kernel/linux-2.6: file.c

CVS commit program cvs at parl.clemson.edu
Fri Mar 12 15:58:55 EST 2004


Update of /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6
In directory parlweb:/tmp/cvs-serv10697/src/kernel/linux-2.6

Modified Files:
	file.c 
Log Message:
- bugfix:  undo the silliest behaviour is the history of file systems
  (don't arbitrarily set the inode's file size to 0 when it's closed --
  it causes errors if the inode is in use by someone else)
  -- this fixes the SIGBUS problems i was seeing when trying to do a
  'make -j3' of pvfs2 ON pvfs2.
  - yes, we can now make -j3 pvfs2 on pvfs!!! :-)
- optimization: don't clear page cache pages if there are none for the inode
  in question (the function fast path returned anyway, but now we avoid the
  call all together in that case)


Index: file.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/kernel/linux-2.6/file.c,v
diff -p -u -r1.56 -r1.57
--- file.c	11 Mar 2004 22:16:09 -0000	1.56
+++ file.c	12 Mar 2004 20:58:55 -0000	1.57
@@ -363,7 +363,10 @@ static int pvfs2_file_mmap(struct file *
     inode->i_mapping->backing_dev_info = &pvfs2_backing_dev_info;
 
     /* and clear any associated pages in the page cache (if any) */
-    truncate_inode_pages(inode->i_mapping, 0);
+    if (inode->i_data.nrpages)
+    {
+        truncate_inode_pages(inode->i_mapping, 0);
+    }
 
     /* have the vfs enforce readonly mmap support for us */
     return generic_file_readonly_mmap(file, vma);
@@ -391,11 +394,11 @@ int pvfs2_file_release(
       data for the next caller of mmap (or 'get_block' accesses)
     */
     if (file->f_dentry->d_inode &&
-        file->f_dentry->d_inode->i_mapping)
+        file->f_dentry->d_inode->i_mapping &&
+        file->f_dentry->d_inode->i_data.nrpages)
     {
         clear_inode_mmap_ra_cache(file->f_dentry->d_inode);
         truncate_inode_pages(file->f_dentry->d_inode->i_mapping, 0);
-        i_size_write(file->f_dentry->d_inode, 0);
     }
     return 0;
 }



More information about the PVFS2-CVS mailing list