pktcdvd: sort set_blocksize() calls out
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 17 Apr 2024 04:28:03 +0000 (00:28 -0400)
committerAl Viro <viro@zeniv.linux.org.uk>
Thu, 2 May 2024 21:23:30 +0000 (17:23 -0400)
commit3a52c03d1ece8f480d6a6c35d92f7c1c6215d2a6
tree5c030f80b831f9d17ccdef81b88070ddb2489d6e
parentaf63dd715a5c6b66bbd1485c2189b92c1a3fba41
pktcdvd: sort set_blocksize() calls out

1) it doesn't make any sense to have ->open() call set_blocksize() on the
device being opened - the caller will override that anyway.

2) setting block size on underlying device, OTOH, ought to be done when
we are opening it exclusive - i.e. as part of pkt_open_dev().  Having
it done at setup time doesn't guarantee us anything about the state
at the time we start talking to it.  Worse, if you happen to have
the underlying device containing e.g. ext2 with 4Kb blocks that
is currently mounted r/o, that set_blocksize() will confuse the hell
out of filesystem.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
drivers/block/pktcdvd.c