From: Dave Chinner Date: Wed, 20 Jul 2016 01:53:35 +0000 (+1000) Subject: Merge branch 'xfs-4.8-buf-fixes' into for-next X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=bbfeb6141fcc8e2aea47b2f235cc8cc8ffb4a293;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git Merge branch 'xfs-4.8-buf-fixes' into for-next --- bbfeb6141fcc8e2aea47b2f235cc8cc8ffb4a293 diff --cc fs/xfs/xfs_buf.c index 4665ff6e5153,2722cb495ef4..32fc5401a756 --- a/fs/xfs/xfs_buf.c +++ b/fs/xfs/xfs_buf.c @@@ -1825,21 -1892,25 +1909,21 @@@ xfs_buf_delwri_submit_buffers continue; } - list_move_tail(&bp->b_list, io_list); trace_xfs_buf_delwri_split(bp, _RET_IP_); - } - - list_sort(NULL, io_list, xfs_buf_cmp); - - blk_start_plug(&plug); - list_for_each_entry_safe(bp, n, io_list, b_list) { - bp->b_flags &= ~(_XBF_DELWRI_Q | XBF_WRITE_FAIL); - bp->b_flags |= XBF_WRITE | XBF_ASYNC; /* - * we do all Io submission async. This means if we need to wait - * for IO completion we need to take an extra reference so the - * buffer is still valid on the other side. + * We do all IO submission async. This means if we need + * to wait for IO completion we need to take an extra + * reference so the buffer is still valid on the other + * side. We need to move the buffer onto the io_list + * at this point so the caller can still access it. */ - bp->b_flags &= ~(_XBF_DELWRI_Q | XBF_ASYNC | XBF_WRITE_FAIL); - if (wait) ++ bp->b_flags &= ~(_XBF_DELWRI_Q | XBF_WRITE_FAIL); + bp->b_flags |= XBF_WRITE | XBF_ASYNC; + if (wait_list) { xfs_buf_hold(bp); - else + list_move_tail(&bp->b_list, wait_list); + } else list_del_init(&bp->b_list); xfs_buf_submit(bp);