summaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_bmap_util.c
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2014-09-16 16:40:38 +0200
committerTakashi Iwai <tiwai@suse.de>2014-09-16 16:40:38 +0200
commit779608521976e3b8d264f89c67e64c918949cc9b (patch)
tree12d604aa1a08b5bf556be11ee9c08b5b6b000179 /fs/xfs/xfs_bmap_util.c
parent7a9744cb455e6faa287e148394b4b422a6f3c5c4 (diff)
parentf7667af21736eb231e3589d9f91183d325cabfbe (diff)
downloadtalos-obmc-linux-779608521976e3b8d264f89c67e64c918949cc9b.tar.gz
talos-obmc-linux-779608521976e3b8d264f89c67e64c918949cc9b.zip
Merge tag 'asoc-v3.17-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.17 This is mostly driver fixes, the biggest one being the tlv320aic31xx which is relatively large but simple and device specific. There's a small fix in the error handling in DPCM too which is relatively minor error handling fix.
Diffstat (limited to 'fs/xfs/xfs_bmap_util.c')
-rw-r--r--fs/xfs/xfs_bmap_util.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index 2f1e30d39a35..1707980f9a4b 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -1470,6 +1470,26 @@ xfs_collapse_file_space(
start_fsb = XFS_B_TO_FSB(mp, offset + len);
shift_fsb = XFS_B_TO_FSB(mp, len);
+ /*
+ * Writeback the entire file and force remove any post-eof blocks. The
+ * writeback prevents changes to the extent list via concurrent
+ * writeback and the eofblocks trim prevents the extent shift algorithm
+ * from running into a post-eof delalloc extent.
+ *
+ * XXX: This is a temporary fix until the extent shift loop below is
+ * converted to use offsets and lookups within the ILOCK rather than
+ * carrying around the index into the extent list for the next
+ * iteration.
+ */
+ error = filemap_write_and_wait(VFS_I(ip)->i_mapping);
+ if (error)
+ return error;
+ if (xfs_can_free_eofblocks(ip, true)) {
+ error = xfs_free_eofblocks(mp, ip, false);
+ if (error)
+ return error;
+ }
+
error = xfs_free_file_space(ip, offset, len);
if (error)
return error;
OpenPOWER on IntegriCloud