nvme: set block size to blkdev before re-read partition
Before re-reading partition information from a block device, to make
block size of the block device, application should do either:
- Close current file descriptor and re-open it again.
- Request block device to set block size by itself.
Kernel community has discussions about it, and can be found at [1].
The first option might not be good for readability in this program which
is one-shot command-based application. All the subcommands are
constructed "fd open -> issue command -> fd close". I don't want to
break the common style for this requirement.
This patch takes the second one and it just ioctl() to the block device
to update it's block size to a given value.
[1] https://lore.kernel.org/linux-nvme/
20210105150214.GA16251@lst.de/T/#u
Signed-off-by: Minwoo Im <minwoo.im.dev@gmail.com>