Skip to contentSkip to conversation

XFS and Quotas and Q_SYNC

DISCUSSION Jan Kara 1 participant 1 message Mar 24, 2003 4 messages not in the archive VFS

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): 20030305043131.GC1512@frodo

A message that is not in the archive (sent off-list or not yet received): [email protected]

A message that is not in the archive (sent off-list or not yet received): [email protected]

Jan Kara

author
#4 lore raw

Hello,

so I created the patch which adds possibility to sync all devices at
once to quotactl(2) interface. Please test it and let me know so I can send the patch to Linus. The attached patch is against 2.5.64. The version for 2.4.20 kernel can be found at ftp://atrey.karlin.mff.cuni.cz/pub/local/jack/quota/v2.4/2.4.20/ (it's actually complete set of my patches containing also the change).

Honza

Quoted 36 lines
Quoted 6 lines · Jan Kara
Quoted 4 lines
Quoted 3 lines

1) quotactl(Q_SYNC, NULL) is supposed to sync all quotas. This fails. The manpage still documents it. Is this still valid? I think it needs to be..

It should work... I'll have a look at it. For XFS and other fses it might
noop but it shouldn't fail.

Right, it should just loop and noop where needed. Maybe something like:

        spin_lock(&sb_lock);
        list_for_each(p, &super_blocks) {
                sb = sb_entry(p);
                if (sb->s_qcop->quota_sync)
                        sb->s_qcop->quota_sync(sb, type);
                }
        spin_unlock(&sb_lock);
        return 0;

I appreciate you looking into this one.

Quoted 9 lines
Quoted 5 lines

I believe the fundamental changes to the API were made to support 32 bit uid's/gid's in the VFS quota implementation and changes to the ondisk quota file format. Its my belief that the new versions of the tools could work with either new or old kernels, best check with Jan on that one (nothing to do with XFS).

Right. And to the binary compatibility: Linux is not supposed to
maintain binary compatibily between major kernel releases (eg. 2.2->2.4) and quota changes were accepted in 2.5.

OK, but what of the 2.4 backport? Adding XFS to a 2.4.x kernel breaks binary compatibility. It seems to me that gratuitously changing values so as to gurantee broken compatibility is inane.

Quoted 12 lines

I guess I'll have to deal with this aspect of it. If Q_SYNC for NULL works, then I can get working systems back with a recompile and new headers. Uggh. Not nice to do to me in an update of a backport.

thanks for the info.

Tim

Signature · 4 lines
Tim Hockin
Systems Software Engineer
Sun Microsystems, Linux Kernel Engineering
[email protected]
fs/dquot.c +0 -44
diff -ru linux-2.5.64/fs/dquot.c linux-2.5.64-syncall/fs/dquot.c
@@ -345,50 +345,6 @@
 	return 0;
 }
 
-static struct super_block *get_super_to_sync(int type)
-{
-	struct list_head *head;
-	int cnt, dirty;
-
-restart:
-	spin_lock(&sb_lock);
-	list_for_each(head, &super_blocks) {
-		struct super_block *sb = list_entry(head, struct super_block, s_list);
-
-		for (cnt = 0, dirty = 0; cnt < MAXQUOTAS; cnt++)
-			if ((type == cnt || type == -1) && sb_has_quota_enabled(sb, cnt)
-			    && info_any_dquot_dirty(&sb_dqopt(sb)->info[cnt]))
-				dirty = 1;
-		if (!dirty)
-			continue;
-		sb->s_count++;
-		spin_unlock(&sb_lock);
-		down_read(&sb->s_umount);
-		if (!sb->s_root) {
-			drop_super(sb);
-			goto restart;
-		}
-		return sb;
-	}
-	spin_unlock(&sb_lock);
-	return NULL;
-}
-
-void sync_dquots(struct super_block *sb, int type)
-{
-	if (sb) {
-		if (sb->s_qcop->quota_sync)
-			sb->s_qcop->quota_sync(sb, type);
-	}
-	else {
-		while ((sb = get_super_to_sync(type))) {
-			if (sb->s_qcop->quota_sync)
-				sb->s_qcop->quota_sync(sb, type);
-			drop_super(sb);
-		}
-	}
-}
-
 /* Free unused dquots from cache */
 static void prune_dqcache(int count)
 {
fs/quota.c +64 -14

115 lines not on this page · raw message