From: Jeff Mahoney <jeffm@suse.com>
To: Anton Altaparmakov <aia21@cam.ac.uk>
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
akpm@osdl.org, linux-kernel@vger.kernel.org, torvalds@osdl.org
Subject: Re: [PATCH] fs: remove s_old_blocksize from struct super_block
Date: Sat, 03 Dec 2005 12:42:40 -0500 [thread overview]
Message-ID: <4391D910.206@suse.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0512031429360.11664@hermes-1.csi.cam.ac.uk>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Anton Altaparmakov wrote:
> I have no idea why Jeff (Mahoney) considered the setting to be
> unnecessary, when Al Viro added the resetting code a few years ago it
> was done precisely because utilities were behaving randomly/erratically...
>
> IMHO the above commit consitutes a regression in 2.6 kernel.
Anton -
Linus and I discussed[1] this briefly on the list in March. Here's my
conclusion[2]. My initial attempts tried to preserve the behavior, but
keeping it at the VFS level made the fix more complex. Linus pointed out
that the file systems explicitly set the block size to a known value
before doing anything. Userspace utilities that don't open the block
device with O_EXCL can have the block size changed underneath them in
mid-execution - by the kernel or another userspace process using the
BLKBSZSET ioctl. Incidentally, the ioctl doesn't save the old value either.
I don't think any userspace utility can expect a particular block size
without an exclusive open and explicit set of the block size.
Pushing the resetting of the block size up into the file system doesn't
eliminate the race. The race exists when get_sb_bdev_excl opens the
block device, which it is allowed to do since it's the same file system
type, and then tries to get the super block. If deactivate_super has
already changed sb->s_count -= S_BIAS -1, sget will ignore the
superblock and allocate a new one. It will then call the file system's
fill_super(). Once a new superblock is allocated, the only thing that
the two have in common is the block device and there is nothing
preventing ->fill_super() from running concurrently with anything under
- ->kill_sb(). This includes ->put_super() as well, so pushing the reset
up into the individual file systems would just preserve/reintroduce the
race.
bdev->bd_mount_sem might be a workable synchronization point for this if
you truly want to preserve the old behavior.
- -Jeff
[1]: http://www.ussg.iu.edu/hypermail/linux/kernel/0503.1/2369.html
[2]: http://www.ussg.iu.edu/hypermail/linux/kernel/0503.2/0460.html
- --
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFDkdkQLPWxlyuTD7IRAo0uAJ4+JQOz5g47rVlGZzwoaELY1G3q1QCfWSi+
HfGC1KAvRhm+YXU47cTK83U=
=JHuY
-----END PGP SIGNATURE-----
next prev parent reply other threads:[~2005-12-03 17:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-12-02 21:20 [PATCH] fs: remove s_old_blocksize from struct super_block Pekka Enberg
2005-12-02 21:44 ` Pekka Enberg
2005-12-03 11:02 ` Anton Altaparmakov
2005-12-03 11:34 ` Pekka Enberg
2005-12-03 14:34 ` Anton Altaparmakov
2005-12-03 17:42 ` Jeff Mahoney [this message]
2005-12-03 18:52 ` Linus Torvalds
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=4391D910.206@suse.com \
--to=jeffm@suse.com \
--cc=aia21@cam.ac.uk \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=penberg@cs.helsinki.fi \
--cc=torvalds@osdl.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