Skip to content

Commit

Permalink
nilfs2: fix disorder in cp count on error during deleting checkpoints
Browse files Browse the repository at this point in the history
This fixes a bug that checkpoint count gets wrong on errors when
deleting a series of checkpoints.

The count error is persistent since the checkpoint count is stored on
disk.  Some userland programs refer to the count via ioctl, and this
bugfix is needed to prevent malfunction of such programs.

Signed-off-by: Jiro SEKIBA <jir@unicus.jp>
Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Cc: stable@kernel.org
  • Loading branch information
Jiro SEKIBA authored and Ryusuke Konishi committed Jul 5, 2009
1 parent ff54de3 commit d9a0a34
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions fs/nilfs2/cpfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
ret = nilfs_cpfile_get_checkpoint_block(cpfile, cno, 0, &cp_bh);
if (ret < 0) {
if (ret != -ENOENT)
goto out_header;
break;
/* skip hole */
ret = 0;
continue;
Expand Down Expand Up @@ -340,7 +340,7 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
continue;
printk(KERN_ERR "%s: cannot delete block\n",
__func__);
goto out_header;
break;
}
}

Expand All @@ -358,7 +358,6 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
kunmap_atomic(kaddr, KM_USER0);
}

out_header:
brelse(header_bh);

out_sem:
Expand Down

0 comments on commit d9a0a34

Please sign in to comment.