Skip to content

Commit 349dbc3

Browse files
committed
nilfs2: fix infinite loop in nilfs_palloc_freev function
After having applied commit 9954e7a ("nilfs2: add free entries count only if clear bit operation succeeded"), a free routine of nilfs came to fall into an infinite loop, outputting the same message endlessly: nilfs_palloc_freev: entry number 29497 already freed nilfs_palloc_freev: entry number 29497 already freed nilfs_palloc_freev: entry number 29497 already freed nilfs_palloc_freev: entry number 29497 already freed nilfs_palloc_freev: entry number 29497 already freed ... That patch broke the routine so that a loop counter is never updated in an abnormal state. This fixes the regression. Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
1 parent 693d92a commit 349dbc3

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎fs/nilfs2/alloc.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ int nilfs_palloc_freev(struct inode *inode, __u64 *entry_nrs, size_t nitems)
646646
unsigned long group, group_offset;
647647
int i, j, n, ret;
648648

649-
for (i = 0; i < nitems; i += n) {
649+
for (i = 0; i < nitems; i = j) {
650650
group = nilfs_palloc_group(inode, entry_nrs[i], &group_offset);
651651
ret = nilfs_palloc_get_desc_block(inode, group, 0, &desc_bh);
652652
if (ret < 0)

0 commit comments

Comments
 (0)