public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Suzuki Kp <suzuki@in.ibm.com>
To: Erik Mouw <erik@harddisk-recovery.com>
Cc: lkml <linux-kernel@vger.kernel.org>,
	linux-fsdevel@vger.kernel.org, Andrew Morton <akpm@osdl.org>,
	andmike@us.ibm.com
Subject: [RFC] PATCH to fix rescan_partitions to return errors properly  - take 2
Date: Thu, 05 Oct 2006 13:32:34 -0700	[thread overview]
Message-ID: <45256BE2.5040702@in.ibm.com> (raw)
In-Reply-To: <20061005104018.GC7343@harddisk-recovery.nl>

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

Erik,


Erik Mouw wrote:
> On Wed, Oct 04, 2006 at 10:37:49AM -0700, Suzuki Kp wrote:
> 
>>Erik Mouw wrote:
>>
>>>I disagree. It's perfectly valid for a disk not to have a partition
>>>table (for example: components of a RAID5 MD device) and we shouldn't
>>>scare users about that. Also an unrecognised partition table format
>>>(DEC VMS, Novell Netware, etc.) is not a reason to throw an error, it's
>>>just unrecognised and as far as the kernel knows it's unpartioned.
>>

[...]


Thank you very much for the inputs.

As per the discussion I have made the changes to the patch.

This change needs to be implemented in some of the partition checkers 
which doesn't do that already.

Btw, do you think it is a good idea to let the other partition checkers 
run, even if one of them has failed ?

Right now, the check_partition runs the partition checkers in a 
sequential manner, until it finds a success or an error.


Comments ?

Thanks,

Suzuki


[-- Attachment #2: fix-rescan_partitions-take2.diff --]
[-- Type: text/x-patch, Size: 1007 bytes --]


* Fix rescan_partition to propagate the low level I/O error.



Signed Off by: Suzuki K P <suzuki@in.ibm.com>

Index: linux-2.6.18/fs/partitions/check.c
===================================================================
--- linux-2.6.18.orig/fs/partitions/check.c     2006-09-26 04:41:55.000000000 +0530
+++ linux-2.6.18/fs/partitions/check.c  2006-10-06 01:22:06.000000000 +0530
@@ -177,7 +177,7 @@
        else if (warn_no_part)
                printk(" unable to read partition table\n");
        kfree(state);
-       return NULL;
+       return ERR_PTR(res);
 }

 /*
@@ -460,6 +460,9 @@
                disk->fops->revalidate_disk(disk);
        if (!get_capacity(disk) || !(state = check_partition(disk, bdev)))
                return 0;
+       if (IS_ERR(state))
+       /* I/O error reading the partition table */
+               return -EIO;
        for (p = 1; p < state->limit; p++) {
                sector_t size = state->parts[p].size;
                sector_t from = state->parts[p].from;

  reply	other threads:[~2006-10-05 20:32 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-04  1:00 [RFC] PATCH to fix rescan_partitions to return errors properly Suzuki Kp
2006-10-04 13:09 ` Erik Mouw
2006-10-04 16:50   ` Suzuki Kp
2006-10-04 17:08     ` Erik Mouw
2006-10-04 17:37       ` Suzuki Kp
2006-10-05 10:40         ` Erik Mouw
2006-10-05 20:32           ` Suzuki Kp [this message]
2006-10-05 22:07             ` [RFC] PATCH to fix rescan_partitions to return errors properly - take 2 Andrew Morton
2006-10-06 12:53             ` Erik Mouw
2006-10-06 17:43               ` Suzuki K P
2006-10-06 21:07                 ` Erik Mouw
2006-10-07  1:46                   ` [RFC] Fix check_partition routines ( was Re: [RFC] PATCH to fix rescan_partitions to return errors properly - take 2) Suzuki K P
2006-10-07  2:45                     ` Andrew Morton

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=45256BE2.5040702@in.ibm.com \
    --to=suzuki@in.ibm.com \
    --cc=akpm@osdl.org \
    --cc=andmike@us.ibm.com \
    --cc=erik@harddisk-recovery.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox