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

CVS commit program cvs at parl.clemson.edu
Tue Mar 23 11:30:12 EST 2004


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

Modified Files:
	file.c 
Log Message:
- fix a race in the vfs read path that could allow the device to free an op
  (just before it's killed) that has already been freed by the read
- some comment format cleanups


Index: file.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/kernel/linux-2.6/file.c,v
diff -p -u -r1.60 -r1.61
--- file.c	22 Mar 2004 23:28:19 -0000	1.60
+++ file.c	23 Mar 2004 16:30:12 -0000	1.61
@@ -104,18 +104,18 @@ ssize_t pvfs2_inode_read(
         new_op->upcall.req.io.io_type = PVFS_IO_READ;
         new_op->upcall.req.io.refn = pvfs2_inode->refn;
 
-	/* get a buffer for the transfer */
-	/* note that we get a new buffer each time for fairness, though
-	 * it may speed things up in the common case more if we kept one
-	 * buffer the whole time; need to measure performance difference
+	/* note that we get a new buffer each time for fairness,
+	 * though it may speed things up in the common case more if we
+	 * kept one buffer the whole time; need to measure performance
+	 * difference
 	 */
 	ret = pvfs_bufmap_get(&buffer_index);
 	if (ret < 0)
 	{
 	    pvfs2_error("pvfs2: error: pvfs_bufmap_get() failure.\n");
 	    ret = new_op->downcall.status;
-            op_release(new_op);
             kill_device_owner();
+            op_release(new_op);
 	    pvfs_bufmap_put(buffer_index);
 	    *offset = original_offset;
 	    return(ret);
@@ -248,10 +248,10 @@ static ssize_t pvfs2_file_write(
 
 	pvfs2_print("pvfs2: writing %d bytes.\n", count);
 
-	/* get a buffer for the transfer */
-	/* note that we get a new buffer each time for fairness, though
-	 * it may speed things up in the common case more if we kept one
-	 * buffer the whole time; need to measure performance difference
+	/* note that we get a new buffer each time for fairness,
+	 * though it may speed things up in the common case more if we
+	 * kept one buffer the whole time; need to measure performance
+	 * difference
 	 */
 	ret = pvfs_bufmap_get(&buffer_index);
 	if(ret < 0)



More information about the PVFS2-CVS mailing list