[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

chown/quota bug in ext3



Hi,
 there appears to be a bug w.r.t. chown and quotas in ext3.

 In particular, if you "chown" a file on a filesystem with userquotas
 enabled, the quota charge in not transfered.
 ditto "chgrp" and group quotas.

 This happens because i_op->setattr has been redefined for files, and
 ext3_setattr doesn't do the DQUOT_TRANSFER like it should.
 I have fixed it by adding a stanza like:


	if ((attr->ia_valid & ATTR_UID && attr->ia_uid != inode->i_uid) ||
	    (attr->ia_valid & ATTR_GID && attr->ia_gid != inode->i_gid))
		error = DQUOT_TRANSFER(inode, attr) ? -EDQUOT : 0;
	if (error)
		return error;


into ext3_setattr just after:

	error = inode_change_ok(inode, attr);
	if (error)
		return error;


though possibly it should go just before the:

	rc = inode_setattr(inode, attr);

instead.

NeilBrown





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]