All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian King <brking@us.ibm.com>
To: brking@us.ibm.com
Cc: James.Bottomley@steeleye.com, linux-scsi@vger.kernel.org
Subject: Re: [PATCH 1/1] scsicam_getgeo_odd_sector_size
Date: Wed, 13 Oct 2004 09:01:26 -0500	[thread overview]
Message-ID: <416D3536.5030501@us.ibm.com> (raw)
In-Reply-To: <200408192303.i7JN3cv9110958@northrelay02.pok.ibm.com>

[-- Attachment #1: Type: text/plain, Size: 116 bytes --]

This patch appears to have been dropped. Resending.

-- 
Brian King
eServer Storage I/O
IBM Linux Technology Center

[-- Attachment #2: scsicam_getgeo_odd_sector_size.patch --]
[-- Type: text/plain, Size: 1606 bytes --]


The following BUG() was observed when a scsi disk formatted to 522 bytes/sector
was discovered attached to a sym2 adapter.

<2>kernel BUG in grow_buffers at fs/buffer.c:1271!

which corresponds to:

static inline int
grow_buffers(struct block_device *bdev, sector_t block, int size)
{
        struct page *page;
        pgoff_t index;
        int sizebits;

        /* Size must be multiple of hard sectorsize */
        if (size & (bdev_hardsect_size(bdev)-1))
                BUG();
        if (size < 512 || size > PAGE_SIZE)
                BUG();                      <----- line 1271 is here


The following patch fixes this by not attempting to read the partition table
of a device with an unsupported sector size.


Signed-off-by: Brian King <brking@us.ibm.com>
---

 linux-2.6.9-rc4-bk1-bjking1/drivers/scsi/scsicam.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletion(-)

diff -puN drivers/scsi/scsicam.c~scsicam_getgeo_odd_sector_size drivers/scsi/scsicam.c
--- linux-2.6.9-rc4-bk1/drivers/scsi/scsicam.c~scsicam_getgeo_odd_sector_size	2004-10-13 08:57:46.000000000 -0500
+++ linux-2.6.9-rc4-bk1-bjking1/drivers/scsi/scsicam.c	2004-10-13 08:57:46.000000000 -0500
@@ -29,7 +29,10 @@ unsigned char *scsi_bios_ptable(struct b
 	unsigned char *res = kmalloc(66, GFP_KERNEL);
 	if (res) {
 		struct block_device *bdev = dev->bd_contains;
-		struct buffer_head *bh = __bread(bdev, 0, block_size(bdev));
+		struct buffer_head *bh = NULL;
+
+		if (get_capacity(bdev->bd_disk))
+			bh = __bread(bdev, 0, block_size(bdev));
 		if (bh) {
 			memcpy(res, bh->b_data + 0x1be, 66);
 			brelse(bh);
_

  reply	other threads:[~2004-10-13 14:01 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-19 23:02 [PATCH 1/1] scsicam_getgeo_odd_sector_size brking
2004-10-13 14:01 ` Brian King [this message]
2004-10-13 14:04   ` Matthew Wilcox
2004-10-13 14:25     ` Brian King
2004-10-13 15:45       ` James Bottomley
2004-10-13 19:55         ` Brian King
2004-10-13 21:37           ` James Bottomley
2004-10-13 22:57             ` Brian King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=416D3536.5030501@us.ibm.com \
    --to=brking@us.ibm.com \
    --cc=James.Bottomley@steeleye.com \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.