diff mbox

block: Remove annoying "unknown partition table" message

Message ID 54C0EF78.4030203@plexistor.com (mailing list archive)
State New, archived
Headers show

Commit Message

Boaz Harrosh Jan. 22, 2015, 12:39 p.m. UTC
From: Boaz Harrosh <boaz@plexistor.com>

As Christoph put it:
  Can we just get rid of the warnings?  It's fairly annoying as devices
  without partitions are perfectly fine and very useful.

Me too I see this message every VM boot for ages on all my
devices. Would love to just remove it. For me a partition-table
is only needed for a booting BIOS, grub, and stuff.

CC: Christoph Hellwig <hch@infradead.org>
Signed-off-by: Boaz Harrosh <boaz@plexistor.com>
---
 block/partitions/check.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Boaz Harrosh Jan. 22, 2015, 12:47 p.m. UTC | #1
On 01/22/2015 02:39 PM, Boaz Harrosh wrote:
> From: Boaz Harrosh <boaz@plexistor.com>
> 
> As Christoph put it:
>   Can we just get rid of the warnings?  It's fairly annoying as devices
>   without partitions are perfectly fine and very useful.
> 
> Me too I see this message every VM boot for ages on all my
> devices. Would love to just remove it. For me a partition-table
> is only needed for a booting BIOS, grub, and stuff.
> 
> CC: Christoph Hellwig <hch@infradead.org>
> Signed-off-by: Boaz Harrosh <boaz@plexistor.com>

Jens Hi

Sorry for the delay, was unavailable from beginning of the week.

I have tested this. The message no longer shows.

I also hacked to return -EIO if sector ZERO is read, and
the "unable to read partition table" will show, (as well as 16
other messages complaining at other places). So I guess it is
test.

Thanks
Boaz

> ---
>  block/partitions/check.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/block/partitions/check.c b/block/partitions/check.c
> index 9ac1df7..16118d1 100644
> --- a/block/partitions/check.c
> +++ b/block/partitions/check.c
> @@ -184,12 +184,12 @@ check_partition(struct gendisk *hd, struct block_device *bdev)
>  	if (err)
>  	/* The partition is unrecognized. So report I/O errors if there were any */
>  		res = err;
> -	if (!res)
> -		strlcat(state->pp_buf, " unknown partition table\n", PAGE_SIZE);
> -	else if (warn_no_part)
> -		strlcat(state->pp_buf, " unable to read partition table\n", PAGE_SIZE);
> -
> -	printk(KERN_INFO "%s", state->pp_buf);
> +	if (res) {
> +		if (warn_no_part)
> +			strlcat(state->pp_buf,
> +				" unable to read partition table\n", PAGE_SIZE);
> +		printk(KERN_INFO "%s", state->pp_buf);
> +	}
>  
>  	free_page((unsigned long)state->pp_buf);
>  	free_partitions(state);
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/block/partitions/check.c b/block/partitions/check.c
index 9ac1df7..16118d1 100644
--- a/block/partitions/check.c
+++ b/block/partitions/check.c
@@ -184,12 +184,12 @@  check_partition(struct gendisk *hd, struct block_device *bdev)
 	if (err)
 	/* The partition is unrecognized. So report I/O errors if there were any */
 		res = err;
-	if (!res)
-		strlcat(state->pp_buf, " unknown partition table\n", PAGE_SIZE);
-	else if (warn_no_part)
-		strlcat(state->pp_buf, " unable to read partition table\n", PAGE_SIZE);
-
-	printk(KERN_INFO "%s", state->pp_buf);
+	if (res) {
+		if (warn_no_part)
+			strlcat(state->pp_buf,
+				" unable to read partition table\n", PAGE_SIZE);
+		printk(KERN_INFO "%s", state->pp_buf);
+	}
 
 	free_page((unsigned long)state->pp_buf);
 	free_partitions(state);