Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 319962
b: refs/heads/master
c: fe0627e
h: refs/heads/master
v: v3
  • Loading branch information
Ryusuke Konishi authored and Linus Torvalds committed Jul 31, 2012
1 parent 3ca9e30 commit a9c2a4a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 278038ac53c6c4f53d1d34f978beb9aba1410b2c
refs/heads/master: fe0627e7b3d32a41c16fac6e0af091991545865e
10 changes: 7 additions & 3 deletions trunk/fs/nilfs2/cpfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
__u64 cno;
void *kaddr;
unsigned long tnicps;
int ret, ncps, nicps, count, i;
int ret, ncps, nicps, nss, count, i;

if (unlikely(start == 0 || start > end)) {
printk(KERN_ERR "%s: invalid range of checkpoint numbers: "
Expand All @@ -301,6 +301,7 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
if (ret < 0)
goto out_sem;
tnicps = 0;
nss = 0;

for (cno = start; cno < end; cno += ncps) {
ncps = nilfs_cpfile_checkpoints_in_block(cpfile, cno, end);
Expand All @@ -318,8 +319,9 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
cpfile, cno, cp_bh, kaddr);
nicps = 0;
for (i = 0; i < ncps; i++, cp = (void *)cp + cpsz) {
WARN_ON(nilfs_checkpoint_snapshot(cp));
if (!nilfs_checkpoint_invalid(cp)) {
if (nilfs_checkpoint_snapshot(cp)) {
nss++;
} else if (!nilfs_checkpoint_invalid(cp)) {
nilfs_checkpoint_set_invalid(cp);
nicps++;
}
Expand Down Expand Up @@ -364,6 +366,8 @@ int nilfs_cpfile_delete_checkpoints(struct inode *cpfile,
}

brelse(header_bh);
if (nss > 0)
ret = -EBUSY;

out_sem:
up_write(&NILFS_MDT(cpfile)->mi_sem);
Expand Down

0 comments on commit a9c2a4a

Please sign in to comment.