#include "file-item.h"
#include "ioctl.h"
#include "defrag.h"
+#include "raid56.h"
#include "file.h"
#include "super.h"
#include "print-tree.h"
* checksums attached to the ordered extents.
*/
btrfs_get_ordered_extents_for_logging(inode, &ctx.ordered_extents);
+
+ /*
+ * The writeback wait below completes only when the raid56
+ * layer writes this fsync's data, but a partial-stripe rbio
+ * parks (collecting merges) until its sync deadline, and on
+ * this path nothing else unparks it before the wait -- the
+ * stripes are settled only later, in the logging itself. All
+ * of this fsync's writes are submitted by now, so nothing
+ * more can merge; kick the parked rbios covering our ordered
+ * extents instead of sleeping out their deadline.
+ */
+ if (btrfs_test_opt(fs_info, STRIPE_ALLOC)) {
+ struct btrfs_ordered_extent *tmp_oe;
+
+ list_for_each_entry(tmp_oe, &ctx.ordered_extents,
+ log_list)
+ if (tmp_oe->disk_num_bytes)
+ btrfs_flush_parked_rbios(fs_info,
+ tmp_oe->disk_bytenr,
+ tmp_oe->disk_num_bytes);
+ }
+
ret = filemap_fdatawait_range(inode->vfs_inode.i_mapping, start, end);
if (ret)
goto out_release_extents;