* [PATCH] check bh->b_blocknr only if BH_Mapped is set
@ 2009-02-09 12:18 Nikanth Karthikesan
2009-02-10 20:46 ` Andrew Morton
0 siblings, 1 reply; 3+ messages in thread
From: Nikanth Karthikesan @ 2009-02-09 12:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Jens Axboe, Andrew Morton
check bh->b_blocknr only if BH_Mapped is set
Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
---
diff --git a/fs/buffer.c b/fs/buffer.c
index 665d446..782c365 100644
--- a/fs/buffer.c
+++ b/fs/buffer.c
@@ -344,13 +344,13 @@ __find_get_block_slow(struct block_device *bdev,
sector_t block)
head = page_buffers(page);
bh = head;
do {
- if (bh->b_blocknr == block) {
+ if (!buffer_mapped(bh))
+ all_mapped = 0;
+ else if (bh->b_blocknr == block) {
ret = bh;
get_bh(bh);
goto out_unlock;
}
- if (!buffer_mapped(bh))
- all_mapped = 0;
bh = bh->b_this_page;
} while (bh != head);
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] check bh->b_blocknr only if BH_Mapped is set
2009-02-09 12:18 [PATCH] check bh->b_blocknr only if BH_Mapped is set Nikanth Karthikesan
@ 2009-02-10 20:46 ` Andrew Morton
2009-02-11 6:01 ` Nikanth Karthikesan
0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2009-02-10 20:46 UTC (permalink / raw)
To: Nikanth Karthikesan; +Cc: linux-kernel, jens.axboe
On Mon, 9 Feb 2009 17:48:11 +0530
Nikanth Karthikesan <knikanth@suse.de> wrote:
> check bh->b_blocknr only if BH_Mapped is set
Why?
> diff --git a/fs/buffer.c b/fs/buffer.c
> index 665d446..782c365 100644
> --- a/fs/buffer.c
> +++ b/fs/buffer.c
> @@ -344,13 +344,13 @@ __find_get_block_slow(struct block_device *bdev,
> sector_t block)
> head = page_buffers(page);
> bh = head;
> do {
> - if (bh->b_blocknr == block) {
> + if (!buffer_mapped(bh))
> + all_mapped = 0;
> + else if (bh->b_blocknr == block) {
> ret = bh;
> get_bh(bh);
> goto out_unlock;
> }
> - if (!buffer_mapped(bh))
> - all_mapped = 0;
> bh = bh->b_this_page;
> } while (bh != head);
Does this fix some user-visible misbehaviour? If so, what was that
behaviour?
Please write good changelogs. This is not some pointless book-keeping
exercise. People will make decisions about which kernel versions
patches should be merged into, and they will want to know if a
particular patch addresses a particular problem which they are
experiencing. For this, they need information.
Thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] check bh->b_blocknr only if BH_Mapped is set
2009-02-10 20:46 ` Andrew Morton
@ 2009-02-11 6:01 ` Nikanth Karthikesan
0 siblings, 0 replies; 3+ messages in thread
From: Nikanth Karthikesan @ 2009-02-11 6:01 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, jens.axboe, stack.box
On Wednesday 11 February 2009 02:16:40 Andrew Morton wrote:
> On Mon, 9 Feb 2009 17:48:11 +0530
>
> Nikanth Karthikesan <knikanth@suse.de> wrote:
> > check bh->b_blocknr only if BH_Mapped is set
>
> Why?
>
b_blocknr will have a valid blocknr only when BH_Mapped is set.
> > diff --git a/fs/buffer.c b/fs/buffer.c
> > index 665d446..782c365 100644
> > --- a/fs/buffer.c
> > +++ b/fs/buffer.c
> > @@ -344,13 +344,13 @@ __find_get_block_slow(struct block_device *bdev,
> > sector_t block)
> > head = page_buffers(page);
> > bh = head;
> > do {
> > - if (bh->b_blocknr == block) {
> > + if (!buffer_mapped(bh))
> > + all_mapped = 0;
> > + else if (bh->b_blocknr == block) {
> > ret = bh;
> > get_bh(bh);
> > goto out_unlock;
> > }
> > - if (!buffer_mapped(bh))
> > - all_mapped = 0;
> > bh = bh->b_this_page;
> > } while (bh != head);
>
> Does this fix some user-visible misbehaviour? If so, what was that
> behaviour?
>
No. I was looking at the "Bug 12593 - __find_get_block_slow while using
parted." Even though this may not be the cause of that bug, I think this could
be a potential problem elsewhere.
> Please write good changelogs. This is not some pointless book-keeping
> exercise. People will make decisions about which kernel versions
> patches should be merged into, and they will want to know if a
> particular patch addresses a particular problem which they are
> experiencing. For this, they need information.
>
Sorry for the bad changelog. Thanks for pointing it out.
Thanks
Nikanth
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-02-11 6:03 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-09 12:18 [PATCH] check bh->b_blocknr only if BH_Mapped is set Nikanth Karthikesan
2009-02-10 20:46 ` Andrew Morton
2009-02-11 6:01 ` Nikanth Karthikesan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox