ext4_journal: fix trans->data_cnt not be decremented
authorngkaho1234 <ngkaho1234@gmail.com>
Tue, 29 Dec 2015 16:08:58 +0000 (00:08 +0800)
committergkostka <kostka.grzegorz@gmail.com>
Wed, 30 Dec 2015 08:28:43 +0000 (09:28 +0100)
When buffer is not dirty this counter should be decremented.

lwext4/ext4_journal.c

index 3fa1db6c38db685a53a05930a304006d307760ca..640077873ffa9289b63442133e79461dee2d571c 100644 (file)
@@ -1365,6 +1365,9 @@ static int jbd_journal_prepare(struct jbd_journal *journal,
                                           BC_DIRTY)) {
                        /* The buffer has not been modified, just release
                         * that jbd_buf. */
+                       jbd_trans_remove_block_rec(journal, jbd_buf);
+                       trans->data_cnt--;
+
                        jbd_buf->block.buf->end_write = NULL;
                        jbd_buf->block.buf->end_write_arg = NULL;
                        ext4_block_set(fs->bdev, &jbd_buf->block);