From: "Steve French" <smfrench@gmail.com>
To: "Dave Kleikamp" <shaggy@linux.vnet.ibm.com>
Cc: Nick Piggin <npiggin@suse.de>,
linux-fsdevel <linux-fsdevel@vger.kernel.org>,
pbadari@us.ibm.com, Jeff Layton <jlayton@redhat.com>,
"linux-cifs-client@lists.samba.org"
<linux-cifs-client@lists.samba.org>
Subject: Re: Fwd: fsx-linux failing with latest cifs-2.6 git tree
Date: Fri, 21 Nov 2008 14:38:18 -0600 [thread overview]
Message-ID: <524f69650811211238x3c81d899r225f46776aeb52f1@mail.gmail.com> (raw)
In-Reply-To: <524f69650811211218v78295682lcf6dce842327b097@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2352 bytes --]
Fix attached.
Shaggy/Jeff/Nick etc. do you want to review/ack it since it is late in the rc?
On Fri, Nov 21, 2008 at 2:18 PM, Steve French <smfrench@gmail.com> 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 */
>
>
> On Fri, Nov 21, 2008 at 1:41 PM, Dave Kleikamp
> <shaggy@linux.vnet.ibm.com> wrote:
>> On Fri, 2008-11-21 at 13:13 -0600, Steve French wrote:
>>> Looks like this section of code is wrong in cifs_write_begin:
>>>
>>> if ((file->f_flags & O_ACCMODE) != O_WRONLY) {
>>> int rc;
>>>
>>> /* might as well read a page, it is fast enough */
>>> rc = cifs_readpage_worker(file, *pagep, &offset);
>>>
>>> /* 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 */
>>>
>>>
>>> We see a case in which a write begins at offset 0x2e42f but the range
>>> immediately before it is unitialized in write_begin
>>>
>>> shouldn't we be doing a read of the whole page?
>>
>> What cifs_write_begin() passes in as offset is completely wrong. It
>> should be the file offset of the beginning of the page rather than some
>> offset within the page.
>> --
>> David Kleikamp
>> IBM Linux Technology Center
>>
>>
>
>
>
> --
> Thanks,
>
> Steve
>
--
Thanks,
Steve
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: fsx-fail-fix.patch --]
[-- Type: text/x-diff; name=fsx-fail-fix.patch, Size: 852 bytes --]
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index b691b89..726d437 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -2061,7 +2061,7 @@ static int cifs_write_begin(struct file *file, struct address_space *mapping,
struct page **pagep, void **fsdata)
{
pgoff_t index = pos >> PAGE_CACHE_SHIFT;
- loff_t offset = pos & (PAGE_CACHE_SIZE - 1);
+ loff_t offset_of_page_start = pos & PAGE_MASK;
cFYI(1, ("write_begin from %lld len %d", (long long)pos, len));
@@ -2081,7 +2081,7 @@ 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, &offset_of_page_start);
/* we do not need to pass errors back
e.g. if we do not have read access to the file
[-- Attachment #3: Type: text/plain, Size: 172 bytes --]
_______________________________________________
linux-cifs-client mailing list
linux-cifs-client@lists.samba.org
https://lists.samba.org/mailman/listinfo/linux-cifs-client
next parent reply other threads:[~2008-11-21 20:38 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20081121105613.09a8cb8e@tleilax.poochiereds.net>
[not found] ` <524f69650811210820s549de2bah3181cbc0c5633091@mail.gmail.com>
[not found] ` <20081121112249.0b408b55@tleilax.poochiereds.net>
[not found] ` <524f69650811210846q7502fd99m6f4d335bb6ac1b65@mail.gmail.com>
[not found] ` <524f69650811211109w659e5decoa34a8e0f907772a3@mail.gmail.com>
[not found] ` <524f69650811211113q4fffcc70of88cb85db531c358@mail.gmail.com>
[not found] ` <1227296476.20845.8.camel@norville.austin.ibm.com>
[not found] ` <524f69650811211218v78295682lcf6dce842327b097@mail.gmail.com>
2008-11-21 20:38 ` Steve French [this message]
2008-11-21 20:41 ` Fwd: fsx-linux failing with latest cifs-2.6 git tree Dave Kleikamp
2008-11-21 21:02 ` Steve French
2008-11-21 23:44 ` Nick Piggin
2008-11-21 20:50 ` Jeff Layton
2008-11-21 22:50 ` Jeff Layton
2008-11-21 23:02 ` Dave Kleikamp
2008-11-21 23:25 ` Jeff Layton
2008-11-22 1:04 ` Steve French
2008-11-22 1:50 ` Jeff Layton
2008-11-21 23:53 ` Nick Piggin
2008-11-22 1:51 ` Jeff Layton
2008-11-22 2:02 ` Steve French
2008-11-22 4:47 ` Dave Kleikamp
2008-11-22 15:39 ` [linux-cifs-client] " Jeff Layton
2008-11-22 20:27 ` Dave Kleikamp
2008-11-23 11:57 ` Jeff Layton
2008-11-24 2:32 ` Steve French
2008-11-24 11:19 ` [linux-cifs-client] " Jeff Layton
2008-11-26 4:04 ` Steve French
2008-11-26 11:54 ` Jeff Layton
2008-11-26 12:11 ` Jeff Layton
2008-11-26 13:09 ` [linux-cifs-client] " Nick Piggin
2008-11-26 15:08 ` Jeff Layton
2008-11-26 15:23 ` Nick Piggin
2008-11-26 16:37 ` Jeff Layton
2008-11-27 8:33 ` Nick Piggin
2008-11-28 12:18 ` Jeff Layton
2008-11-30 21:44 ` Steve French
2008-11-30 22:17 ` Jeff Layton
2008-12-01 8:44 ` Nick Piggin
2008-12-01 11:28 ` Jeff Layton
2008-12-01 11:32 ` Nick Piggin
2008-12-01 11:55 ` Jeff Layton
2008-12-01 17:43 ` Steve French
2008-11-26 19:46 ` Steve French
2008-11-24 20:00 ` Dave Kleikamp
2008-11-26 13:02 ` Nick Piggin
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=524f69650811211238x3c81d899r225f46776aeb52f1@mail.gmail.com \
--to=smfrench@gmail.com \
--cc=jlayton@redhat.com \
--cc=linux-cifs-client@lists.samba.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=npiggin@suse.de \
--cc=pbadari@us.ibm.com \
--cc=shaggy@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).