File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -1008,10 +1008,19 @@ static loff_t bch2_seek_hole(struct file *file, u64 offset)
1008
1008
? MAX_LFS_FILESIZE
1009
1009
: k .k -> p .offset << 9 ;
1010
1010
1011
+ /*
1012
+ * Found a hole in the btree, now make sure it's
1013
+ * a hole in the pagecache. We might have to
1014
+ * keep searching if this hole is entirely dirty
1015
+ * in the page cache:
1016
+ */
1011
1017
bch2_trans_unlock (trans );
1012
- next_hole = bch2_seek_pagecache_hole (& inode -> v ,
1013
- start_offset , end_offset , 0 , false);
1014
- break ;
1018
+ loff_t pagecache_hole = bch2_seek_pagecache_hole (& inode -> v ,
1019
+ start_offset , end_offset , 0 , false);
1020
+ if (pagecache_hole < end_offset ) {
1021
+ next_hole = pagecache_hole ;
1022
+ break ;
1023
+ }
1015
1024
} else {
1016
1025
offset = max (offset , bkey_start_offset (k .k ) << 9 );
1017
1026
}
You can’t perform that action at this time.
0 commit comments