From: Tejun Heo <tj@kernel.org>
To: Tony Luck <tony.luck@gmail.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Jens Axboe <axboe@kernel.dk>
Subject: Re: New boot time message: detected capacity change
Date: Thu, 19 May 2011 11:30:26 +0200 [thread overview]
Message-ID: <20110519093026.GA627@htj.dyndns.org> (raw)
In-Reply-To: <BANLkTin3T8msxSSbTLJOvC5WLNFGspPEcg@mail.gmail.com>
On Wed, May 18, 2011 at 01:32:50PM -0700, Tony Luck wrote:
> Today's pull from Linus' tree (HEAD = 258-ga2b9c1f) gave me some new
> messages during boot:
>
> sda: detected capacity change from 0 to 146815737856
> sdb: detected capacity change from 0 to 146815737856
>
> They weren't there yesterday (HEAD = 211-gc1d10d1) ... nor do they
> show up in any of my saved boot time dmesg files for the last few
> months.
>
> Harmless? Or something to worry about in the last few commits
> before 2.6.39 goes final?
Yes, it is harmless. The order was changed between
rescan_partitions() and bd_set_size() - rescan_partitions() checked
for size change too and it resulted in simpler condition checks.
However, rescan_partitions() triggers the above message when it
detects size change unlike the silient bd_set_size().
Does the following patch remove the messages for you?
Thanks.
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 257b00e..bf9c7a7 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1120,6 +1120,15 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
goto restart;
}
}
+
+ if (!ret && !bdev->bd_openers) {
+ bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
+ bdi = blk_get_backing_dev_info(bdev);
+ if (bdi == NULL)
+ bdi = &default_backing_dev_info;
+ bdev_inode_switch_bdi(bdev->bd_inode, bdi);
+ }
+
/*
* If the device is invalidated, rescan partition
* if open succeeded or failed with -ENOMEDIUM.
@@ -1130,14 +1139,6 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
rescan_partitions(disk, bdev);
if (ret)
goto out_clear;
-
- if (!bdev->bd_openers) {
- bd_set_size(bdev,(loff_t)get_capacity(disk)<<9);
- bdi = blk_get_backing_dev_info(bdev);
- if (bdi == NULL)
- bdi = &default_backing_dev_info;
- bdev_inode_switch_bdi(bdev->bd_inode, bdi);
- }
} else {
struct block_device *whole;
whole = bdget_disk(disk, 0);
next prev parent reply other threads:[~2011-05-19 9:30 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-05-18 20:32 Tony Luck
2011-05-18 20:50 ` Linus Torvalds
2011-05-19 5:29 ` Tejun Heo
2011-05-19 6:01 ` Tejun Heo
2011-05-19 7:27 ` Jens Axboe
2011-05-19 7:25 ` Jens Axboe
2011-05-19 9:30 ` Tejun Heo [this message]
2011-05-19 17:39 ` Tony Luck
2011-05-23 11:24 ` [PATCH] block: move bd_set_size() above rescan_partitions() in __blkdev_get() Tejun Heo
2011-05-23 15:51 ` Linus Torvalds
2011-05-23 16:31 ` Jens Axboe
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=20110519093026.GA627@htj.dyndns.org \
--to=tj@kernel.org \
--cc=axboe@kernel.dk \
--cc=linux-kernel@vger.kernel.org \
--cc=tony.luck@gmail.com \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®