]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
mkfs: discard only after all validations
authorJan Tulak <jtulak@redhat.com>
Tue, 9 Oct 2018 16:49:47 +0000 (11:49 -0500)
committerEric Sandeen <sandeen@redhat.com>
Tue, 9 Oct 2018 16:49:47 +0000 (11:49 -0500)
commit915a27a05b19017b478a9c2e356126373022847d
tree0407edc20e630d7cfe03639097fa8f5a3c0d8962
parent9fae859a5f82ff801f8337172481b81a75744ecb
mkfs: discard only after all validations

Discard should happen only when everything has been validated, just
before we start writing to the device. If it happens earlier, it is
possible that mkfs will abort, but managed to already wipe data. This
patch moves the discard to the latest possible moment.

Signed-off-by: Jan Tulak <jtulak@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
mkfs/xfs_mkfs.c