diff -NurP --minimal linux-2.4.22-ctx17a-mq0.10-cx0.06-cq0.09/fs/dquot.c linux-2.4.22-ctx17a-mq0.10-cx0.06-cq0.10/fs/dquot.c --- linux-2.4.22-ctx17a-mq0.10-cx0.06-cq0.09/fs/dquot.c 2003-09-18 23:18:50.000000000 +0200 +++ linux-2.4.22-ctx17a-mq0.10-cx0.06-cq0.10/fs/dquot.c 2003-09-24 18:47:54.000000000 +0200 @@ -399,15 +399,19 @@ if (dquot->dq_type != type) continue; + if (!dquot->dq_inuse.next) + continue; dquot->dq_flags |= DQ_INVAL; - if (dquot->dq_count) + if (dquot->dq_count) { + printk("··· quota in use: %p (%d)\n", dquot, dquot->dq_count); /* * Wait for any users of quota. As we have already cleared the flags in * superblock and cleared all pointers from inodes we are assured * that there will be no new users of this quota. */ __wait_dquot_unused(dquot); + } remove_dquot_hash(dquot); remove_free_dquot(dquot); diff -NurP --minimal linux-2.4.22-ctx17a-mq0.10-cx0.06-cq0.09/fs/quota.c linux-2.4.22-ctx17a-mq0.10-cx0.06-cq0.10/fs/quota.c --- linux-2.4.22-ctx17a-mq0.10-cx0.06-cq0.09/fs/quota.c 2003-09-18 23:19:18.000000000 +0200 +++ linux-2.4.22-ctx17a-mq0.10-cx0.06-cq0.10/fs/quota.c 2003-09-24 17:56:44.000000000 +0200 @@ -462,6 +462,9 @@ if (inode->i_dqh->dqh_qop->drop) inode->i_dqh->dqh_qop->drop(inode); dqhput(inode->i_dqh); + if (inode->i_flags & S_QUOTA) + printk("··· QUOTA still on for %p (%d)", inode, inode->i_ctx); + // inode->i_flags &= ~ inode->i_dqh = NULL; unlock_kernel(); return 0; @@ -473,6 +476,8 @@ struct dqhash *dqh = get_dqhash(sb, ctx); if (!dqhash_valid(dqh) && (cmds == Q_ADD_DQHASH)) { + if (!(sb->s_flags & MS_TAGCTX)) + return -ENOSYS; dqh = new_dqhash(sb, ctx); /* keep one refcount to hash */ return 0;