public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* xfs_io bmap confused
@ 2015-07-08  7:01 Ming Lin
  2015-07-08  8:53 ` Christoph Hellwig
  2015-07-09  2:07 ` Dave Chinner
  0 siblings, 2 replies; 8+ messages in thread
From: Ming Lin @ 2015-07-08  7:01 UTC (permalink / raw)
  To: xfs; +Cc: Christoph Hellwig

Hi list,

I am testing some direct-io patches.
xfs_tests/xfs/080 failed.

It's strange.
There is no hole in "rwtest.file",
but when read it at some offset it returns zero because of hole.

root@block:~# xfs_io -c bmap /mnt/test/rwtest.file
/mnt/test/rwtest.file:
             0: [0..125671]: 160..125831

Then I read at file offset 659456,
root@block:~# dd if=/mnt/test/rwtest.file of=tmp.file bs=512 skip=1288 count=1

The code actually goes to below if statements.

Any idea what's wrong?

139 static struct bio *
140 do_mpage_readpage(struct bio *bio, struct page *page, unsigned nr_pages,
141                 sector_t *last_block_in_bio, struct buffer_head *map_bh,
142                 unsigned long *first_logical_block, get_block_t get_block)
143 {
....
....
209                 if (!buffer_mapped(map_bh)) {
210                         fully_mapped = 0;
211                         if (first_hole == blocks_per_page)
212                                 first_hole = page_block;
213                         page_block++;
214                         block_in_file++;
215                         continue;
216                 }
....
....
249         if (first_hole != blocks_per_page) {
250                 zero_user_segment(page, first_hole << blkbits, PAGE_CACHE_SIZE);
251                 if (first_hole == 0) {
252                         SetPageUptodate(page);
253                         unlock_page(page);
254                         goto out;
255                 }

Thanks,
Ming


_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-07-09 23:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-08  7:01 xfs_io bmap confused Ming Lin
2015-07-08  8:53 ` Christoph Hellwig
2015-07-08 13:57   ` Ming Lin
2015-07-08 23:40     ` Ming Lin
2015-07-09  6:54       ` Ming Lin
2015-07-09 22:41         ` Dave Chinner
2015-07-09 23:28           ` Ming Lin
2015-07-09  2:07 ` Dave Chinner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox