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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 18 Dec 2007 15:04:03 +0100 (CET)
From:	Jan Engelhardt <jengelh@...putergmbh.de>
To:	xfs@....sgi.com
cc:	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Do not reset xfsquota flags on quotaless ro mount

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
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?

===

In the following action sequence, quota is unnecessarily recalculated
at the 3rd mount invocation:

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

This patch skips clearing the quota flags on read-only mounts.

---
 fs/xfs/xfs_qmops.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

Index: linux-2.6/fs/xfs/xfs_qmops.c
===================================================================
--- linux-2.6.orig/fs/xfs/xfs_qmops.c
+++ linux-2.6/fs/xfs/xfs_qmops.c
@@ -134,7 +134,14 @@ static struct xfs_qmops xfs_qmcore_stub 
 int
 xfs_qmops_get(struct xfs_mount *mp, struct xfs_mount_args *args)
 {
-	if (args->flags & (XFSMNT_UQUOTA | XFSMNT_PQUOTA | XFSMNT_GQUOTA)) {
+	bool c;
+
+	c = args->flags & (XFSMNT_UQUOTA | XFSMNT_GQUOTA | XFSMNT_PQUOTA);
+#ifdef CONFIG_XFS_QUOTA
+	c |= mp->m_flags & XFS_MOUNT_RDONLY;
+#endif
+
+	if (c) {
 #ifdef CONFIG_XFS_QUOTA
 		mp->m_qm_ops = &xfs_qmcore_xfs;
 #else
--
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