All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Zorro Lang <zlang@redhat.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH v3] repair: handle reading superblock from image on larger sector size filesystem
Date: Mon, 10 Apr 2017 22:57:11 -0500	[thread overview]
Message-ID: <f8caee4a-d8aa-1aa5-bb17-b8c7142bf17d@sandeen.net> (raw)
In-Reply-To: <20170411032541.GO21915@dhcp12-143.nay.redhat.com>

On 4/10/17 10:25 PM, Zorro Lang wrote:
> On Mon, Apr 10, 2017 at 12:16:41PM -0500, Eric Sandeen wrote:
>> On 4/6/17 7:05 AM, Zorro Lang wrote:
>>> Due to xfs_repair uses direct IO, sometimes it can't read superblock
>>> from an image file has smaller sector size than host filesystem.
>>> Especially that superblock doesn't align with host filesystem's
>>> sector size.
>>>
>>> Fortunately, xfsprogs already has code to do isa_file and geometry
>>> check in xfs_repair.c, it turns off O_DIRECT after phase1() if the
>>> sector size is less than the host filesystem's geometry. So move
>>> the isa_file auto detection over up the phase1(), and try to do
>>> once geometry check before phase1() if get_sb() return OK.
>>
>> Zorro, can you do a quick test for me - does a filesystem which fails
>> repair without this patch also fail xfs_copy if the source and/or
>> destination of the copy is on this same filesystem/device as the image
>> file in your xfs_repair test?
> 
> Sure, the xfs_copy has similar problem. I'm writting a xfstests case to
> do xfs_repair and xfs_copy a file image likes this. Do you have any other
> related suggestions which I can write them together?

Any userspace which needs to read a filesystem image probably has the same
issue.

I'm wondering if all of this handling should somehow be factored out and
re-used across the utilities...

-Eric

  parent reply	other threads:[~2017-04-11  3:57 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-06 12:05 [PATCH v3] repair: handle reading superblock from image on larger sector size filesystem Zorro Lang
2017-04-10 17:16 ` Eric Sandeen
2017-04-11  3:25   ` Zorro Lang
2017-04-11  3:43     ` Zorro Lang
2017-04-11  3:57     ` Eric Sandeen [this message]
2017-04-11  4:31       ` Zorro Lang
2017-04-11 13:38         ` Eric Sandeen
2017-04-10 18:00 ` Eric Sandeen

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=f8caee4a-d8aa-1aa5-bb17-b8c7142bf17d@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=linux-xfs@vger.kernel.org \
    --cc=zlang@redhat.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 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.