storage: Force sync after preparing volatile.img

This makes possible to release d-m partitions devices sooner (so avoid
race with kpartx).
This commit is contained in:
Marek Marczykowski-Górecki 2013-08-31 00:26:45 +02:00
parent ea68c6a766
commit 8d0863d40f

View File

@ -31,6 +31,7 @@ kpartx -s -a "$FILENAME"
loopdev=`losetup -j "$FILENAME"|tail -n 1 |cut -d: -f1`
looppart=`echo $loopdev|sed 's:dev:dev/mapper:'`
mkswap -f ${looppart}p1 > /dev/null
sync
kpartx -s -d ${loopdev}
losetup -d ${loopdev} || :
chown --reference `dirname "$FILENAME"` "$FILENAME"