Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 222790
b: refs/heads/master
c: 309c848
h: refs/heads/master
v: v3
  • Loading branch information
Dave Chinner authored and Alex Elder committed Dec 1, 2010
1 parent 23fd758 commit 32ed312
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 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: 90810b9e82a36c3c57c1aeb8b2918b242a130b26
refs/heads/master: 309c848002052edbec650075a1eb098b17c17f35
9 changes: 7 additions & 2 deletions trunk/fs/xfs/xfs_bmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -5471,8 +5471,13 @@ xfs_getbmap(
if (error)
goto out_unlock_iolock;
}

ASSERT(ip->i_delayed_blks == 0);
/*
* even after flushing the inode, there can still be delalloc
* blocks on the inode beyond EOF due to speculative
* preallocation. These are not removed until the release
* function is called or the inode is inactivated. Hence we
* cannot assert here that ip->i_delayed_blks == 0.
*/
}

lock = xfs_ilock_map_shared(ip);
Expand Down
13 changes: 13 additions & 0 deletions trunk/fs/xfs/xfs_dfrag.c
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,19 @@ xfs_swap_extents(
ip->i_d.di_format = tip->i_d.di_format;
tip->i_d.di_format = tmp;

/*
* The extents in the source inode could still contain speculative
* preallocation beyond EOF (e.g. the file is open but not modified
* while defrag is in progress). In that case, we need to copy over the
* number of delalloc blocks the data fork in the source inode is
* tracking beyond EOF so that when the fork is truncated away when the
* temporary inode is unlinked we don't underrun the i_delayed_blks
* counter on that inode.
*/
ASSERT(tip->i_delayed_blks == 0);
tip->i_delayed_blks = ip->i_delayed_blks;
ip->i_delayed_blks = 0;

ilf_fields = XFS_ILOG_CORE;

switch(ip->i_d.di_format) {
Expand Down

0 comments on commit 32ed312

Please sign in to comment.