All of lore.kernel.org
 help / color / mirror / Atom feed
* nfs3_proc_write()
@ 2003-07-03 11:09 David Chow
  2003-07-03 11:30 ` nfs3_proc_write() Trond Myklebust
  0 siblings, 1 reply; 5+ messages in thread
From: David Chow @ 2003-07-03 11:09 UTC (permalink / raw)
  To: linux-fsdevel, trond.myklebust

Trond,

I am in the middle of porting the my old nfs_swap code from 2.4.19 to 
2.4.21 .   I notice the interface of nfs3_proc_write() has changed, the 
old code uses a (char *)buffer but the new one uses a (struct page *) . 
When I did the following change, it didn't work.

#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,20)
    u8               *buffer = (char *)kmap(page);
#endif

 result = NFS_PROTO(inode)->write(inode, cred,
                         &fattr,
                         NFS_RW_SWAP|NFS_RW_SYNC,
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,4,20)
                         offset, wsize, page, &verf);
#else                         
                         offset, wsize, buffer, &verf);
#endif                         


What happens is it causes an exception in kmap() which is called by 
xdr_kmap() . By tracing the stack with kdb, the path is as follows

nfs3_proc_write-> nfs3_rpc_wrapper->
  rpc_call_sync->rpc_execute->__rpc_execute->call_transmit->xprt_trnasmit->
    do_xprt_transmit->xdr_kmap->kmap(inlined)


By using objdump, the exact instruction which fails in the xdr_kmap() as 
the following

        len = PAGE_CACHE_SIZE;
        if (first_kmap) {
            first_kmap = 0;
 !!!!           iov->iov_base = kmap(*ppage); !!!!
        } else {


The exception is caused by the return page_address(page) . I've also 
tried a trival kmap(page) before triggering nfs3_proc_write() but the 
result is the same. My system only have 128MB RAM so I think it is 
trival that kmap(0 will actually do anything. Looks like the write path 
code of nfs has change a bit which causes this not going to work.  The 
reason why nfs_writepage_sync() can't be used is because the 
nfs_writepage_sync()  assumes page_offset(page) equals to file offset 
but in a swap page this is not true. Please give some hints what is 
going on or which part of code I should look for.

regards,
David Chow


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

end of thread, other threads:[~2003-07-03 12:41 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-07-03 11:09 nfs3_proc_write() David Chow
2003-07-03 11:30 ` nfs3_proc_write() Trond Myklebust
2003-07-03 11:49   ` nfs3_proc_write() Trond Myklebust
2003-07-03 12:29     ` nfs3_proc_write() David Chow
2003-07-03 12:55       ` nfs3_proc_write() Trond Myklebust

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.