MRP-1306 target: Fix assigning an connection flag for export.

LU-1623 introduce atomically update export connection flags for MDT.
The same issue exist for OST. In any case the flags would be updated
for export, even if error handling code path occured.

This patch combines LU-1623, MRP-1208 and add additional fixing for
the same error for OSS and MGS sides.

Signed-off-by: Alexey Lyashkov <alexey_lyashkov@xyratex.com>
Signed-off-by: Alexander Boyko <alexander_boyko@xyratex.com>
Change-Id: Ic187502595d86ead61dd65b932114f7aa9965394
Reviewed-on: http://morpheus.xyus.xyratex.com:8443/gerrit/668
Tested-by: Jenkins
Tested-by: Alexander Lezhoev <Alexander_Lezhoev@xyratex.com>
Reviewed-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com>
Reviewed-by: Alexey Lyashkov <Alexey_Lyashkov@xyratex.com>
Reviewed-by: Vitaly Fertman <Vitaly_Fertman@xyratex.com>
MRP-1347 ost: deadlock with system flush

Writeback truncated page unter transaction lock.
It prevets flush from taking truncated page

Change-Id: I9f1f11cbafd2bebfdb661f1cac172388f1f60f76
Signed-off-by: Andriy Skulysh <Andriy_Skulysh@xyratex.com>
Reviewed-on: http://morpheus.xyus.xyratex.com:8443/gerrit/670
Tested-by: Jenkins
Reviewed-by: Cheng Shao <cheng_shao@xyratex.com>
Reviewed-by: Alexey Lyashkov <Alexey_Lyashkov@xyratex.com>
Tested-by: Alexander Lezhoev <Alexander_Lezhoev@xyratex.com>
Reviewed-by: Vitaly Fertman <Vitaly_Fertman@xyratex.com>