patch-2.4.21 linux-2.4.21/fs/reiserfs/tail_conversion.c

Next file: linux-2.4.21/fs/select.c
Previous file: linux-2.4.21/fs/reiserfs/super.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.20/fs/reiserfs/tail_conversion.c linux-2.4.21/fs/reiserfs/tail_conversion.c
@@ -105,8 +105,10 @@
 	/* we only send the unbh pointer if the buffer is not up to date.
 	** this avoids overwriting good data from writepage() with old data
 	** from the disk or buffer cache
+	** Special case: unbh->b_page will be NULL if we are coming through
+	** DIRECT_IO handler here.
 	*/
-	if (buffer_uptodate(unbh) || Page_Uptodate(unbh->b_page)) {
+	if ( !unbh->b_page || buffer_uptodate(unbh) || Page_Uptodate(unbh->b_page)) {
 	    up_to_date_bh = NULL ;
 	} else {
 	    up_to_date_bh = unbh ;
@@ -131,6 +133,7 @@
 
     inode->u.reiserfs_i.i_first_direct_byte = U32_MAX;
 
+    reiserfs_update_tail_transaction(inode);
     return 0;
 }
 

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