From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Steve French" Subject: Re: Fwd: fsx-linux failing with latest cifs-2.6 git tree Date: Fri, 21 Nov 2008 15:02:56 -0600 Message-ID: <524f69650811211302w6e713771jf19dd20bc9db00de@mail.gmail.com> References: <20081121105613.09a8cb8e@tleilax.poochiereds.net> <524f69650811210820s549de2bah3181cbc0c5633091@mail.gmail.com> <20081121112249.0b408b55@tleilax.poochiereds.net> <524f69650811210846q7502fd99m6f4d335bb6ac1b65@mail.gmail.com> <524f69650811211109w659e5decoa34a8e0f907772a3@mail.gmail.com> <524f69650811211113q4fffcc70of88cb85db531c358@mail.gmail.com> <1227296476.20845.8.camel@norville.austin.ibm.com> <524f69650811211218v78295682lcf6dce842327b097@mail.gmail.com> <524f69650811211238x3c81d899r225f46776aeb52f1@mail.gmail.com> <1227300101.20845.11.camel@norville.austin.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Nick Piggin" , "Jeff Layton" , pbadari@us.ibm.com, linux-fsdevel , "linux-cifs-client@lists.samba.org" To: "Dave Kleikamp" Return-path: Received: from ey-out-2122.google.com ([74.125.78.26]:46771 "EHLO ey-out-2122.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752040AbYKUVC6 (ORCPT ); Fri, 21 Nov 2008 16:02:58 -0500 Received: by ey-out-2122.google.com with SMTP id 6so471013eyi.37 for ; Fri, 21 Nov 2008 13:02:56 -0800 (PST) In-Reply-To: <1227300101.20845.11.camel@norville.austin.ibm.com> Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-ID: thx ... the only other thing I noticed was that the original patch removed 2067 if ((offset >= i_size) || 2068 ((from == 0) && (offset + to) >= i_size)) { 2069 /* 2070 * We don't need to read data beyond the end of the file. 2071 * zero it, and set the page uptodate 2072 */ 2073 simple_prepare_write(file, page, from, to); 2074 SetPageUptodate(page); which means we do a lot of extra reads (which return no bytes) when we write near or at end of file On Fri, Nov 21, 2008 at 2:41 PM, Dave Kleikamp wrote: > On Fri, 2008-11-21 at 14:38 -0600, Steve French wrote: >> Fix attached. >> >> Shaggy/Jeff/Nick etc. do you want to review/ack it since it is late in the rc? > > Acked-by: Dave Kleikamp > >> >> On Fri, Nov 21, 2008 at 2:18 PM, Steve French wrote: >> > Looks like the following change to cifs_write_begin does fix it ... >> > thanks Shaggy ... >> > >> > @@ -2062,8 +2074,10 @@ static int cifs_write_begin(struct file *file, >> > struct address_space *mapping, >> > { >> > pgoff_t index = pos >> PAGE_CACHE_SHIFT; >> > loff_t offset = pos & (PAGE_CACHE_SIZE - 1); >> > + loff_t page_start = pos & PAGE_MASK; >> > >> > cFYI(1, ("write_begin from %lld len %d", (long long)pos, len)); >> > @@ -2081,13 +2095,14 @@ static int cifs_write_begin(struct file *file, >> > struct address_space *mapping, >> > int rc; >> > >> > /* might as well read a page, it is fast enough */ >> > - rc = cifs_readpage_worker(file, *pagep, &offset); >> > + rc = cifs_readpage_worker(file, *pagep, &page_start); >> > >> > /* we do not need to pass errors back >> > e.g. if we do not have read access to the file >> > because cifs_write_end will attempt synchronous writes >> > -- shaggy */ >> > >> > > > -- > David Kleikamp > IBM Linux Technology Center > > -- Thanks, Steve