--- linux/fs/reiserfs/inode.c.orig Tue Dec 18 14:50:24 2001
+++ linux/fs/reiserfs/inode.c Tue Dec 18 14:52:04 2001
@@ -273,7 +273,9 @@
pathrelse (&path);
if (p)
kunmap(bh_result->b_page) ;
- if ((args & GET_BLOCK_NO_HOLE)) {
+ // We do not return -ENOENT if there is a hole but page is uptodate, because it means
+ // That there is some MMAPED data associated with it that is yet to be written to disk.
+ if ((args & GET_BLOCK_NO_HOLE) && !Page_Uptodate(bh_result->b_page) ) {
return -ENOENT ;
}
return 0 ;
@@ -294,9 +296,13 @@
bh_result->b_dev = inode->i_dev;
bh_result->b_blocknr = blocknr;
bh_result->b_state |= (1UL << BH_Mapped);
- } else if ((args & GET_BLOCK_NO_HOLE)) {
- ret = -ENOENT ;
- }
+ } else
+ // We do not return -ENOENT if there is a hole but page is uptodate, because it means
+ // That there is some MMAPED data associated with it that is yet to be written to disk.
+ if ((args & GET_BLOCK_NO_HOLE) && !Page_Uptodate(bh_result->b_page) ) {
+ ret = -ENOENT ;
+ }
+
pathrelse (&path);
if (p)
kunmap(bh_result->b_page) ;