Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af054ed0 authored by David S. Miller's avatar David S. Miller
Browse files

ide-cd: Don't warn on bogus block size unless it actually matters.



Frans Pop reported that his CDROM drive reports a blocksize of 2352,
and this causes new warnings due to commit
e8e7b9eb ("ide-cd: fix oops when using
growisofs").

What we're trying to do is make sure that "blocklen >> SECTOR_BITS"
is something the block layer won't choke on.

And for Frans' case "2352 >> SECTOR_BITS" is equal to
"2048 >> SECTOR_BITS", and thats "4".

So warning in this case gives no real benefit.

Reported-by: default avatarFrans Pop <elendil@planet.nl>
Tested-by: default avatarFrans Pop <elendil@planet.nl>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ffc36c76
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -876,9 +876,12 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity,
		return stat;
		return stat;


	/*
	/*
	 * Sanity check the given block size
	 * Sanity check the given block size, in so far as making
	 * sure the sectors_per_frame we give to the caller won't
	 * end up being bogus.
	 */
	 */
	blocklen = be32_to_cpu(capbuf.blocklen);
	blocklen = be32_to_cpu(capbuf.blocklen);
	blocklen = (blocklen >> SECTOR_BITS) << SECTOR_BITS;
	switch (blocklen) {
	switch (blocklen) {
	case 512:
	case 512:
	case 1024:
	case 1024: