lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 19 Dec 2007 01:38:49 +1100
From:	David Chinner <dgc@....com>
To:	Jan Engelhardt <jengelh@...putergmbh.de>
Cc:	xfs@....sgi.com,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: Do not reset xfsquota flags on quotaless ro mount

On Tue, Dec 18, 2007 at 03:04:03PM +0100, Jan Engelhardt wrote:
> Hi,
> 
> 
> In https://bugzilla.novell.com/show_bug.cgi?id=345338 it is claimed that
> resetting the quota flags in the mounting sequence rw,ro,rw is a bug, but I

You mounted without quotas in the middle step, thereby invalidating
them.

> would say this is not the case, as quota is metadata, and the log is replayed
> in ro mode even for other filesystems. Yet, it is still not nice, and I have
> been trying with this patch, which does not do the right thing yet. (It does a
> recovery when mounting for the 3rd time, which probably just says that I did
> not know too much of xfs internals to cook up a nicely working patch.)
> Opinions?

Log recovery occurs on read only mounts. Log recovery on filesystems without
quota enabled ignores quota changes in the log (as quotas are not enabled
and hence we can't assume that there's dquots still on disk). Hence a
mount read only without quota enabled will leave quota inconsistent on disk.

i.e

> 	mount -o usrquota,grpquota /dev/mapper/myxfs /mnt
> 	umount /mnt
> 	mount -o ro /dev/mapper/myxfs /mnt

Quota is now potentially inconsistent, and hence:

> 	umount /mnt
> 	mount -o usrquota,grpquota /dev/mapper/myxfs /mnt

This mount *must* recalculate it. So, behaviour is as expected
given the above command sequence.

You should use this as the middle step:

	mount -o ro,usrquota,grpquota /dev/mapper/myxfs /mnt

So that log replay replays all the journalled quota changes so
that the quota remains consistent with the rest of the filesystem.
Then you wont see a recalc when you remount rw.

Cheers,

Dave.
-- 
Dave Chinner
Principal Engineer
SGI Australian Software Group
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ