Fix quota on ploop for RHEL5 CT

This commit fixes two issues preventing in-container disk quota
to work inside a RHEL/CentOS 5 container with ploop layout.

First, ploop uses ext4 new quota format (vfsv0) which quota tools
should deal with. Support for this format appeared in quota-3.16,
so commit ebbf339 adds a check for it.

Red Hat backported this support to their quota tools, so in RHEL5
quota-3.13-4.el5 already supports it (see RH bug #500231 and
RHBA-2011-0023). Since this version is < 3.16 vzctl was still
giving this warning:

	Old quota utils version detected: Quota utilities version 3.13.
	Quota utils version should be > 3.16

This patch adds a special case for RHEL5, checking for quota-3.13-4.el5
or newer, so the above message goes away.

Second, there is one more issue that doesn't work in RHEL5 quota tools:

	# rpm -q quota
	quota-3.13-5.el5

	# grep vfsv0 /etc/mtab /proc/mounts
	/etc/mtab:/dev/ploop43776p1 / ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group
0 0
	/proc/mounts:/dev/ploop43776p1 / ext4 rw,relatime,barrier=1,data=ordered,balloon_ino=12,jqfmt=vfsv0,usrjquota=aquota.user,grpjquota=aquota.group
0 0

	# quotacheck -anugmM
	quotacheck: Unknown quota format: vfsv0,
	Supported formats are:
	  vfsold - original quota format
	  vfsv0 - new quota format
	  rpc - use RPC calls
	  xfs - XFS quota format
	quotacheck: Cannot detect quota format for journalled quota on /
	quotacheck: Cannot guess format from filename on /dev/ploop43776p1.
	Please specify format on commandline.

So it mistakenly parses , as a part of format version, instead of
discarding it.

The workaround is simple: specify format on the command line.

Signed-off-by: Kir Kolyshkin <kir@openvz.org>
1 file changed