]> git.ipfire.org Git - thirdparty/util-linux.git/commit
blkdiscard: use O_EXCL, add --force
authorKarel Zak <kzak@redhat.com>
Thu, 9 Jan 2020 10:03:51 +0000 (11:03 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 23 Jan 2020 14:49:55 +0000 (15:49 +0100)
commit34fed3ff1740aded9c2aae6b5d67a4eb696f738e
tree0f18013e69e46cf764a1acb30483b68cb079109f
parente3e7cd659ec001cb2c2ebaa55d08231ad819deda
blkdiscard: use O_EXCL, add --force

Let's make it more robust and safe. O_EXCL is an elegant way how to avoid
unwanted discard on mounted device.

Addresses: https://github.com/karelzak/util-linux/issues/915
Signed-off-by: Karel Zak <kzak@redhat.com>
sys-utils/blkdiscard.8
sys-utils/blkdiscard.c