[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CA+55aFw=-cN2wrRJ0bcktn=oc6JKSfOPDSF3GsBosDB5fOzozw@mail.gmail.com>
Date: Thu, 29 Nov 2012 12:10:53 -0800
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Chris Mason <chris.mason@...ionio.com>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Chris Mason <clmason@...ionio.com>,
Mikulas Patocka <mpatocka@...hat.com>,
Al Viro <viro@...iv.linux.org.uk>,
Jens Axboe <axboe@...nel.dk>,
Jeff Chua <jeff.chua.linux@...il.com>,
Lai Jiangshan <laijs@...fujitsu.com>, Jan Kara <jack@...e.cz>,
lkml <linux-kernel@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>
Subject: Re: [PATCH v2] Do a proper locking for mmap and block size change
On Thu, Nov 29, 2012 at 11:55 AM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
>
> The blkdev_get_blocks() this is just sad.
>
> The underlying data structure is actually byte-based (it's
> "i_size_read(bdev->bd_inode"), but we convert it to a block-based
> number.
>
> Oops.
Oh, it's even worse than that. The DIO code ends up passing in buffer
heads that have sizes bigger than the inode i_blksize, which can cause
problems at the end of the disk. So blkdev_get_blocks() knows about
it, and will then "fix" that and shrink them down. The games with
"max_block" are hilarious.
In a really sad way.
That whole blkdev_get_blocks() function is pure and utter shit.
Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists