From: "Theodore Y. Ts'o" <tytso@mit.edu>
To: Artem Blagodarenko <artem.blagodarenko@gmail.com>
Cc: <linux-ext4@vger.kernel.org>, <adilger.kernel@dilger.ca>
Subject: Re: [PATCH v7 1/4] ext2fs: opening filesystem code refactoring
Date: Wed, 6 Mar 2019 11:48:46 -0500 [thread overview]
Message-ID: <20190306164846.GA3485@mit.edu> (raw)
In-Reply-To: <20190129175134.26652-2-c17828@cray.com>
On Tue, Jan 29, 2019 at 08:51:31PM +0300, Artem Blagodarenko wrote:
> There are similar opening filesystem code in different utilities.
>
> The patch moves improved handling from try_open_fs()
> into ext2fs_open(). This function make one of the action
> based on parameters:
> 1) open filesystem with given superblock, superblock size
> 2) open filesystem with given superblock, but try to
> find right block size
This changes the behavior of ext2fs_open() when the superblock and
blocksize parameters is zero. Previously we read the primary
superblock at the known location, and a blocksize of zero means "don't
care" and so we just do the right thing. With your patch, it's going
to loop for all possible block sizes, failing with
EXT2_ET_UNEXPECTED_BLOCK_SIZE, until we stumble on the correct file
system. That's unfortunate, especially if the device is opened with
IO_FLAG_DIRECT_IO.
So the brute force searching should be done using if an explicit flag
is given. Using a new flag to request this new behavior is safer, but
it's probably OK if we only do the blocksize search if the superblock
parameter is zero --- you'll note that's what the code you were
replacing in dumpe2fs and e2fsck was doing.
More generally, for this whole patch series, in the "happy case" where
the file system is fine, e2fsck and e2image should *not* do any extra
work.
- Ted
next prev parent reply other threads:[~2019-03-06 16:48 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-01-29 17:51 [PATCH v7 0/4] e2image -b option to pass superblock number Artem Blagodarenko
2019-01-29 17:51 ` [PATCH v7 1/4] ext2fs: opening filesystem code refactoring Artem Blagodarenko
2019-01-30 3:01 ` Andreas Dilger
2019-03-06 16:48 ` Theodore Y. Ts'o [this message]
2019-03-06 17:06 ` Theodore Y. Ts'o
2019-01-29 17:51 ` [PATCH v7 2/4] e2image: add -b and -B options to use supperblock backup Artem Blagodarenko
2019-01-30 3:06 ` Andreas Dilger
2019-03-06 17:06 ` Theodore Y. Ts'o
2019-01-29 17:51 ` [PATCH v7 3/4] tests: add test for e2image -b option Artem Blagodarenko
2019-01-29 17:51 ` [PATCH v7 4/4] ext2fs: automaticlly open backup superblocks Artem Blagodarenko
2019-01-30 3:10 ` Andreas Dilger
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=20190306164846.GA3485@mit.edu \
--to=tytso@mit.edu \
--cc=adilger.kernel@dilger.ca \
--cc=artem.blagodarenko@gmail.com \
--cc=linux-ext4@vger.kernel.org \
/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).