From: Jan Kara <jack@suse.cz>
To: Christoph Hellwig <hch@infradead.org>
Cc: jack@suse.cz, linux-fsdevel@vger.kernel.org
Subject: Re: [PATCH 1/6] dquot: move remount handling into the filesystem
Date: Tue, 18 May 2010 00:34:18 +0200 [thread overview]
Message-ID: <20100517223418.GG3364@quack.suse.cz> (raw)
In-Reply-To: <20100512194453.440456468@bombadil.infradead.org>
On Wed 12-05-10 15:44:09, Christoph Hellwig wrote:
> Currently do_remount_sb calls into the dquot code to tell it about going
> from rw to ro and ro to rw. Move this code into the filesystem to
> not depend on the dquot code in the VFS - note ocfs2 already ignores
> these calls and handles remount by itself. This gets rif of overloading
> the quotactl calls and allows to unify the VFS and XFS codepathes in
> that area later.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
>
It seems you have missed out UDF from the conversion (maybe you could
setup a checklist of filesystem to convert? :) OTOH looking at it more in
detail quota support for UDF is broken (i.e. quotaon returns EINVAL because
.quota_write is not set) for several years now and noone has complained so
I'm starting to wonder whether fixing it is worth the effort.
Also I'm slightly concerned that previous vfs_dq_quota_on_remount was
called only after
sb->s_flags = (sb->s_flags & ~MS_RMT_MASK) | (flags & MS_RMT_MASK);
so in particular MS_RDONLY has been cleared. Now it is called before so
some filesystem could possibly barf when it sees writes from quota system
before MS_RDONLY gets cleared. I've checked and only JFS could have this
problem since others already clear MS_RDONLY inside their foo_remount()
functions but still...
> Index: linux-2.6/fs/ext2/super.c
> ===================================================================
> --- linux-2.6.orig/fs/ext2/super.c 2010-05-10 22:42:00.615256048 +0200
> +++ linux-2.6/fs/ext2/super.c 2010-05-10 22:42:19.030253953 +0200
> @@ -1191,6 +1191,7 @@ static int ext2_remount (struct super_bl
> unsigned long old_mount_opt = sbi->s_mount_opt;
> struct ext2_mount_options old_opts;
> unsigned long old_sb_flags;
> + int enable_quota = 0;
> int err;
>
> spin_lock(&sbi->s_lock);
> @@ -1241,6 +1242,7 @@ static int ext2_remount (struct super_bl
> spin_unlock(&sbi->s_lock);
> return 0;
> }
> +
> /*
> * OK, we are remounting a valid rw partition rdonly, so set
> * the rdonly flag and then mark the partition as valid again.
> @@ -1248,6 +1250,14 @@ static int ext2_remount (struct super_bl
> es->s_state = cpu_to_le16(sbi->s_mount_state);
> es->s_mtime = cpu_to_le32(get_seconds());
> spin_unlock(&sbi->s_lock);
> +
> + err = vfs_dq_off(sb, 1);
> + if (err < 0 && err != -ENOSYS) {
> + err = -EBUSY;
> + spin_lock(&sbi->s_lock);
> + goto restore_opts;
> + }
> +
> ext2_sync_super(sb, es, 1);
> } else {
> __le32 ret = EXT2_HAS_RO_COMPAT_FEATURE(sb,
> @@ -1269,8 +1279,13 @@ static int ext2_remount (struct super_bl
> if (!ext2_setup_super (sb, es, 0))
> sb->s_flags &= ~MS_RDONLY;
> spin_unlock(&sbi->s_lock);
> +
> ext2_write_super(sb);
> + enable_quota = 1;
> }
> +
> + if (enable_quota)
> + vfs_dq_quota_on_remount(sb);
I kind of miss the purpose of "enable_quota" in the above...
Also the ENOSYS check was there only for filesystems which do not support
quotas. Since all the filesystems that call vfs_dq_off now obviously do
support quotas, you can just drop it.
Honza
--
Jan Kara <jack@suse.cz>
SUSE Labs, CR
next prev parent reply other threads:[~2010-05-17 22:34 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-12 19:44 [PATCH 0/6] more quota cleanups Christoph Hellwig
2010-05-12 19:44 ` [PATCH 1/6] dquot: move remount handling into the filesystem Christoph Hellwig
2010-05-17 22:34 ` Jan Kara [this message]
2010-05-19 10:55 ` Christoph Hellwig
2010-05-19 13:47 ` Jan Kara
2010-05-12 19:44 ` [PATCH 2/6] quota: kill the vfs_dq_off and vfs_dq_quota_on_remount wrappers Christoph Hellwig
2010-05-17 22:46 ` Jan Kara
2010-05-12 19:44 ` [PATCH 3/6] dquot: move unmount handling into the filesystem Christoph Hellwig
2010-05-17 22:58 ` Jan Kara
2010-05-19 11:03 ` Christoph Hellwig
2010-05-12 19:44 ` [PATCH 4/6] quota: drop remount argument to ->quota_on and ->quota_off Christoph Hellwig
2010-05-17 23:00 ` Jan Kara
2010-05-12 19:44 ` [PATCH 5/6] quota: explicitly set ->dq_op and ->s_qcop Christoph Hellwig
2010-05-17 23:06 ` Jan Kara
2010-05-19 11:07 ` Christoph Hellwig
2010-05-12 19:44 ` [PATCH 6/6] quota: rename default quotactl methods to dqout_ Christoph Hellwig
2010-05-17 23:09 ` Jan Kara
2010-05-19 11:07 ` Christoph Hellwig
-- strict thread matches above, loose matches on Subject: below --
2010-05-19 11:16 [PATCH 0/6] more quota cleanups V2 Christoph Hellwig
2010-05-19 11:16 ` [PATCH 1/6] dquot: move remount handling into the filesystem Christoph Hellwig
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=20100517223418.GG3364@quack.suse.cz \
--to=jack@suse.cz \
--cc=hch@infradead.org \
--cc=linux-fsdevel@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).