linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Antonov <saproj@gmail.com>
To: Viacheslav Dubeyko <slava@dubeyko.com>
Cc: "linux-fsdevel@vger.kernel.org" <linux-fsdevel@vger.kernel.org>,
	Anton Altaparmakov <aia21@cam.ac.uk>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Christoph Hellwig <hch@infradead.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Hin-Tak Leung <htl10@users.sourceforge.net>,
	Sougata Santra <sougata@tuxera.com>
Subject: Re: [PATCH] hfsplus: fix cross-page bio requests
Date: Sun, 7 Jun 2015 22:09:21 +0200	[thread overview]
Message-ID: <CABikg9w2wSaGArU-gZOtwT3uThRmAtZg7DAzGSMSJQPWGCNEPw@mail.gmail.com> (raw)
In-Reply-To: <CABikg9yU7gZgOR0b13GA1iNEw7B5BtedePBqJw0jp6TNKnzHAg@mail.gmail.com>

On 7 June 2015 at 22:05, Sergei Antonov <saproj@gmail.com> wrote:
> On 10 April 2015 at 18:48, Viacheslav Dubeyko <slava@dubeyko.com> wrote:
>> On Fri, 2015-04-10 at 11:02 +0200, Sergei Antonov wrote:
>>> Function hfsplus_submit_bio() did not work when the passed buffer spanned
>>> over more than one page. That was because bio_alloc() is passed 1 as a number
>>> of vectors but more than one vector were added inside the 'while' loop.
>>> It periodically caused a mount error when the volume header could not be read.
>>>
>>> This patch modifies the code so that only one vector is used. It works for
>>> multiple pages too. Also adds a return code check after bio_alloc().
>>
>> I think that it really makes sense to describe the issue's reproducing
>> way. It will be really precious for understanding of symptoms and
>> reasons of the issue.
>>
>> Could you add more detailed description?
>>
>> Then, I will have opportunity to test your patch.
>
> Well, the description says it all. To put it bluntly, when this line
> from wrapper.c
>   sbi->s_vhdr_buf = kmalloc(hfsplus_min_io_size(sb), GFP_KERNEL);
> assigns s_vhdr_buf a value satisfying condition (PAGE_SIZE - (value &
> PAGE_SIZE) < 512) then this call (also from wrapper.c) returns an

I'm sorry, the right condition is (PAGE_SIZE - (value & (PAGE_SIZE - 1)) < 512).

> error:
>   error = hfsplus_submit_bio(sb, part_start + HFSPLUS_VOLHEAD_SECTOR,
>     sbi->s_vhdr_buf, (void **)&sbi->s_vhdr,
>     READ);
>
> To give a specific example, sbi->s_vhdr_buf equal to
> 0xffff8804085acec0 spans two pages and hfsplus_submit_bio() can not
> read into such a buffer, returns an error, mount operation fails.

  reply	other threads:[~2015-06-07 20:09 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-10  9:02 [PATCH] hfsplus: fix cross-page bio requests Sergei Antonov
2015-04-10 16:48 ` Viacheslav Dubeyko
2015-06-07 20:05   ` Sergei Antonov
2015-06-07 20:09     ` Sergei Antonov [this message]
2015-06-08 17:03       ` Viacheslav Dubeyko
2015-06-08 17:20         ` Sergei Antonov
2015-06-09 16:36           ` Viacheslav Dubeyko
2015-06-09 22:32 ` Anton Altaparmakov
2015-06-09 23:53   ` Sergei Antonov
2015-06-10  5:05     ` hch

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=CABikg9w2wSaGArU-gZOtwT3uThRmAtZg7DAzGSMSJQPWGCNEPw@mail.gmail.com \
    --to=saproj@gmail.com \
    --cc=aia21@cam.ac.uk \
    --cc=akpm@linux-foundation.org \
    --cc=hch@infradead.org \
    --cc=htl10@users.sourceforge.net \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=slava@dubeyko.com \
    --cc=sougata@tuxera.com \
    --cc=viro@zeniv.linux.org.uk \
    /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).