Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 297912
b: refs/heads/master
c: ecb8bea
h: refs/heads/master
v: v3
  • Loading branch information
Liu Bo authored and Chris Mason committed Mar 29, 2012
1 parent a904e0b commit f952b08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 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: 15d1ff8111aad85d8b40ee396758990d17a2caac
refs/heads/master: ecb8bea87d05fd2d1fc0718e1e4bbf09c7c6045a
6 changes: 5 additions & 1 deletion trunk/fs/btrfs/ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1137,12 +1137,16 @@ int btrfs_defrag_file(struct inode *inode, struct file *file,
ra_index += max_cluster;
}

mutex_lock(&inode->i_mutex);
ret = cluster_pages_for_defrag(inode, pages, i, cluster);
if (ret < 0)
if (ret < 0) {
mutex_unlock(&inode->i_mutex);
goto out_ra;
}

defrag_count += ret;
balance_dirty_pages_ratelimited_nr(inode->i_mapping, ret);
mutex_unlock(&inode->i_mutex);

if (newer_than) {
if (newer_off == (u64)-1)
Expand Down

0 comments on commit f952b08

Please sign in to comment.