linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question about nfs_page_async_flush assertion
@ 2010-11-18 10:53 Peng Tao
  2010-11-18 15:27 ` Trond Myklebust
  0 siblings, 1 reply; 3+ messages in thread
From: Peng Tao @ 2010-11-18 10:53 UTC (permalink / raw)
  To: linux-nfs; +Cc: linux-kernel

Hi, all,

nfs_writepages calls into
write_cache_pages()->nfs_writepages_callback()->nfs_do_writepage()->nfs_page_async_flush(),
where it asserts BUG_ON(test_bit(PG_CLEAN, &req->wb_flags)).
My question is: how do we guarantee the request has PG_CLEAN flag set?

nfs_writepages calls:
 356         nfs_pageio_init_write(&pgio, inode, wb_priority(wbc));
 357         err = write_cache_pages(mapping, wbc,
nfs_writepages_callback, &pgio);
 358         nfs_pageio_complete(&pgio);

IIUC, the request will only be issued in nfs_pageio_complete() and
there nfs_write_rpcsetup() will call
nfs_writeback_release_full()->nfs_mark_request_commit() to set the
PG_CLEAN flag. If the request has not ever been issued before entering
nfs_writepages, the PG_CLEAN flag will not be set and the BUG_ON will
be triggered. Am I missing something?

-- 
Thanks,
-Bergwolf

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

* Re: Question about nfs_page_async_flush assertion
  2010-11-18 10:53 Question about nfs_page_async_flush assertion Peng Tao
@ 2010-11-18 15:27 ` Trond Myklebust
  2010-11-18 17:22   ` Peng Tao
  0 siblings, 1 reply; 3+ messages in thread
From: Trond Myklebust @ 2010-11-18 15:27 UTC (permalink / raw)
  To: Peng Tao; +Cc: linux-nfs, linux-kernel

On Thu, 2010-11-18 at 18:53 +0800, Peng Tao wrote:
> Hi, all,
> 
> nfs_writepages calls into
> write_cache_pages()->nfs_writepages_callback()->nfs_do_writepage()->nfs_page_async_flush(),
> where it asserts BUG_ON(test_bit(PG_CLEAN, &req->wb_flags)).
> My question is: how do we guarantee the request has PG_CLEAN flag set?

We don't. We guarantee that the request has PG_CLEAN cleared, and that
is done when we dirty the page (see nfs_try_to_update_request()).

Cheers
  Trond


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

* Re: Question about nfs_page_async_flush assertion
  2010-11-18 15:27 ` Trond Myklebust
@ 2010-11-18 17:22   ` Peng Tao
  0 siblings, 0 replies; 3+ messages in thread
From: Peng Tao @ 2010-11-18 17:22 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: linux-nfs, linux-kernel

On Thu, Nov 18, 2010 at 11:27 PM, Trond Myklebust
<trond.myklebust@fys.uio.no> wrote:
> On Thu, 2010-11-18 at 18:53 +0800, Peng Tao wrote:
>> Hi, all,
>>
>> nfs_writepages calls into
>> write_cache_pages()->nfs_writepages_callback()->nfs_do_writepage()->nfs_page_async_flush(),
>> where it asserts BUG_ON(test_bit(PG_CLEAN, &req->wb_flags)).
>> My question is: how do we guarantee the request has PG_CLEAN flag set?
>
> We don't. We guarantee that the request has PG_CLEAN cleared, and that
> is done when we dirty the page (see nfs_try_to_update_request()).
Ah, I missed. It is test_bit() other than !test_bit(). Thank you Trond
for pointing it out.
Sorry for the spam :)

-- 
Thanks,
-Bergwolf

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

end of thread, other threads:[~2010-11-18 17:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-11-18 10:53 Question about nfs_page_async_flush assertion Peng Tao
2010-11-18 15:27 ` Trond Myklebust
2010-11-18 17:22   ` Peng Tao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).