diff options
author | David S. Miller <davem@davemloft.net> | 2009-06-23 19:01:06 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-06-24 03:32:30 -0400 |
commit | af054ed0018f0a69f8ea6f7546cbf34385edf13b (patch) | |
tree | 3c83e7452f6e0ecb14a278ab833626fa3e51a687 /drivers/ide/ide-cd.c | |
parent | ffc36c7610731115c77700dcc53901920361c235 (diff) |
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
e8e7b9eb11c34ee18bde8b7011af41938d1ad667 ("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: Frans Pop <elendil@planet.nl>
Tested-by: Frans Pop <elendil@planet.nl>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/ide/ide-cd.c')
-rw-r--r-- | drivers/ide/ide-cd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index 4a19686fcfe9..a9a1bfb14e7c 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
@@ -876,9 +876,12 @@ static int cdrom_read_capacity(ide_drive_t *drive, unsigned long *capacity, | |||
876 | return stat; | 876 | return stat; |
877 | 877 | ||
878 | /* | 878 | /* |
879 | * Sanity check the given block size | 879 | * Sanity check the given block size, in so far as making |
880 | * sure the sectors_per_frame we give to the caller won't | ||
881 | * end up being bogus. | ||
880 | */ | 882 | */ |
881 | blocklen = be32_to_cpu(capbuf.blocklen); | 883 | blocklen = be32_to_cpu(capbuf.blocklen); |
884 | blocklen = (blocklen >> SECTOR_BITS) << SECTOR_BITS; | ||
882 | switch (blocklen) { | 885 | switch (blocklen) { |
883 | case 512: | 886 | case 512: |
884 | case 1024: | 887 | case 1024: |