When we unlink an inode which has only one last reference, we are going to free the space in this inode. So free the quota space at the same time. Signed-off-by: Dongsheng Yang <yangds.fnst@xxxxxxxxxxxxxx> --- fs/ubifs/journal.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/fs/ubifs/journal.c b/fs/ubifs/journal.c index 0b9da5b..a6e02f4 100644 --- a/fs/ubifs/journal.c +++ b/fs/ubifs/journal.c @@ -58,6 +58,8 @@ * all the nodes. */ +#include <linux/quotaops.h> + #include "ubifs.h" /** @@ -614,6 +616,10 @@ int ubifs_jnl_update(struct ubifs_info *c, const struct inode *dir, goto out_finish; } ui->del_cmtno = c->cmt_no; + if (S_ISREG(inode->i_mode)) { + dquot_initialize((struct inode *)inode); + dquot_free_space_nodirty((struct inode *)inode, inode->i_size); + } } err = write_head(c, BASEHD, dent, len, &lnum, &dent_offs, sync); -- 1.8.4.2 -- To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html