+ /*
+ * Reordering precautions: make sure that request processing that
+ * was able to receive its bulk data should not get reordered with
+ * overlapping BRW requests, e.g.
+ * 1) BRW1 sent, bulk data received, but disk I/O delayed
+ * 2) BRW1 resent and fully processed
+ * 3) the page was unlocked on the client and its writeback bit reset
+ * 4) BRW2 sent and fully processed
+ * 5) BRW1 processing wakes up and writes stale data to disk
+ * If on step 1 bulk data was not received, client resend will invalidate
+ * its bulk descriptor and the RPC will be dropped due to failed bulk
+ * transfer, which is just fine.
+ */
+ range_lock_init(range,
+ rnb[0].rnb_offset,
+ rnb[obj->ioo_bufcnt - 1].rnb_offset +
+ rnb[obj->ioo_bufcnt - 1].rnb_len - 1);
+ range_lock(&fo->ofo_write_tree, range);
+ ofd_info(env)->fti_range_locked = 1;
+