From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Chow Subject: Re: nfs3_proc_write() Date: Thu, 03 Jul 2003 20:29:55 +0800 Sender: linux-fsdevel-owner@vger.kernel.org Message-ID: <3F0421C3.50000@shaolinmicro.com> References: <3F040ECD.7070108@shaolinmicro.com> <16132.5105.444892.610300@charged.uio.no> <16132.6203.796332.727898@charged.uio.no> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Cc: linux-fsdevel@vger.kernel.org Return-path: Received: from [202.94.238.145] ([202.94.238.145]:32946 "EHLO mail.shaolinmicro.com") by vger.kernel.org with ESMTP id S261188AbTGCMPf (ORCPT ); Thu, 3 Jul 2003 08:15:35 -0400 To: trond.myklebust@fys.uio.no List-Id: linux-fsdevel.vger.kernel.org Trond Myklebust wrote: >>>>>>" " == Trond Myklebust writes: >>>>>> >>>>>> > > > You don't want to be writing wsize bytes unless wsize <= > > PAGE_SIZE. My guess is that this is why you are seeing the > > exception. > >Actually, thinking about it one more time... > >You've just thrown the file offset as the argument to ->write() >instead of setting the offset relative to the start of the page, >haven't you? > >That will *seriously* confuse the RPC sendmsg() code (which is where >you say the Oops occurs). It just wants to know at what offset within >the page you specified it is supposed to start sending data... > >Cheers, > Trond > > Yep, I've just discovered and fix the problem by adding two extra rpc_nfs_ops called offset_read() and offset_wirte() which allow read/write from arbitrary offsets. Some preliminary test has passed. I think using page_offset(page) to calculate the offset from PAGE_CACHE_SIZE is not a pretty good idea. As this interface doesn't look like nfs protocol 2/3/4 . Also, it will prohitbit any implementation of swap over NFS because page->index has no meaning to the actual writing offset of the swapfile. Anyway, it is only my personal recommendation, but looks like it does prohibits some functionality. Thanks for your comment. regards, David Chow