public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Ming Lin <mlin@kernel.org>
To: xfs@oss.sgi.com
Cc: Christoph Hellwig <hch@lst.de>
Subject: xfs_io bmap confused
Date: Wed, 08 Jul 2015 00:01:53 -0700	[thread overview]
Message-ID: <1436338913.13729.11.camel@hasee> (raw)

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

             reply	other threads:[~2015-07-08  7:02 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-08  7:01 Ming Lin [this message]
2015-07-08  8:53 ` xfs_io bmap confused 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1436338913.13729.11.camel@hasee \
    --to=mlin@kernel.org \
    --cc=hch@lst.de \
    --cc=xfs@oss.sgi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox