From: MITSUNARI Shigeo <herumi@nifty.com>
To: linux-fsdevel@vger.kernel.org
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
linux-kernel@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
MITSUNARI Shigeo <herumi@nifty.com>
Subject: [PATCH 1/2] block: fs: bd_invalidated should be cleared in revalidate_disk
Date: Fri, 19 Oct 2012 12:16:41 +0900 [thread overview]
Message-ID: <1350616602-6892-2-git-send-email-herumi@nifty.com> (raw)
In-Reply-To: <1350616602-6892-1-git-send-email-herumi@nifty.com>
rescan_partitions() and invalidate_partitions() in block/partition-generic.c
set bdev->bd_invalidated = 0 after calling check_disk_size_change().
But revalidate_disk() in fs/block_dev.c does not clear it.
If bdev->bd_invalidated = 1 then rescan_partitions() is called when
__blkdev_get() is called.
So if revalidate_disk() is once called, all buffer cache pages will be
cleared whenever the device is opened.
This patch fixes the bug.
I add bdev->bd_invalidated = 0; after calling check_disk_size_change().
Signed-off-by: MITSUNARI Shigeo <herumi@nifty.com>
---
fs/block_dev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/block_dev.c b/fs/block_dev.c
index 38e721b..2577cf4 100644
--- a/fs/block_dev.c
+++ b/fs/block_dev.c
@@ -1047,6 +1047,7 @@ int revalidate_disk(struct gendisk *disk)
mutex_lock(&bdev->bd_mutex);
check_disk_size_change(disk, bdev);
+ bdev->bd_invalidated = 0;
mutex_unlock(&bdev->bd_mutex);
bdput(bdev);
return ret;
--
1.7.9.5
next prev parent reply other threads:[~2012-10-19 3:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-19 3:16 [PATCH 0/2] bd_invalidated shoud " MITSUNARI Shigeo
2012-10-19 3:16 ` MITSUNARI Shigeo [this message]
2012-10-19 3:16 ` [PATCH 2/2] block: fs: move 'bdev->bd_invalidated = 0' into check_disk_size_change() instead of putting the code every time after check_disk_size_change() MITSUNARI Shigeo
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=1350616602-6892-2-git-send-email-herumi@nifty.com \
--to=herumi@nifty.com \
--cc=axboe@kernel.dk \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
/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®