On Mon 08-12-08 17:49:22, Mingming Cao wrote: > > > + /* Dirtify all the dquots - this can block when journalling */ > > > + for (cnt = 0; cnt < MAXQUOTAS; cnt++) > > > + if (inode->i_dquot[cnt]) > > > + mark_dquot_dirty(inode->i_dquot[cnt]); > > > + up_read(&sb_dqopt(inode->i_sb)->dqptr_sem); > > > + > > > + /* Update inode bytes */ > > > + inode_add_bytes(inode, number); > > And this should be called from under dq_data_lock from > > dquot_claim_reserved_space(). > > BTW: This reminds me that you should also modify dquot_transfer() function. > > Because that should not only transfer i_blocks sectors from one user > > to another but it has to also transfer the amount reserved for that inode... > > I think the easiest way around this would be to change i_blocks already when > > reservation is acquired (and than substract it when some of it is given back). > > > > I did looked at dquot_transfer() (not very deep though) before, I wasn't > sure who is calling/needs dquot_transfer()? I noticed ext23 has the > transfer operation defined, but I dont see it's being used. Any hint? ext[34]_setattr() calls DQUOT_TRANSFER() when owner of an inode is being changed. This function subtracts the amount of space file occupies from originating user and adds it to the destination user. Honza -- Jan Kara <jack@xxxxxxx> SUSE Labs, CR -- To unsubscribe from this list: send the line "unsubscribe linux-ext4" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html