On Fri, Mar 15, 2013 at 06:24:38PM -0400, Jeff Mahoney wrote:
> Commit d646a02a9d44d1421f273ae3923d97b47b918176 upstream.

Thanks, queuing for 3.5 kernel.

Cheers,
--
Luis

> 
> blkdev_ioctl(GETBLKSIZE) uses i_size_read() to read size of block
> device.  If we update block size directly, reader may see intermediate
> result in some machines and configurations.  Use i_size_write()
> instead.
> 
> Signed-off-by: Guo Chao <[email protected]>
> Cc: Alexander Viro <[email protected]>
> Cc: Guo Chao <[email protected]>
> Cc: M. Hindess <[email protected]>
> Cc: Nikanth Karthikesan <[email protected]>
> Cc: Jens Axboe <[email protected]>
> Cc: [email protected] # 3.0 3.2 3.4 3.8
> Signed-off-by: Andrew Morton <[email protected]>
> Signed-off-by: Jens Axboe <[email protected]>
> Acked-by: Jeff Mahoney <[email protected]>
> ---
>  fs/block_dev.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/block_dev.c b/fs/block_dev.c
> index 172f849..82b7c9a 100644
> --- a/fs/block_dev.c
> +++ b/fs/block_dev.c
> @@ -1032,7 +1032,9 @@ void bd_set_size(struct block_device *bdev, loff_t size)
>  {
>       unsigned bsize = bdev_logical_block_size(bdev);
>  
> -     bdev->bd_inode->i_size = size;
> +     mutex_lock(&bdev->bd_inode->i_mutex);
> +     i_size_write(bdev->bd_inode, size);
> +     mutex_unlock(&bdev->bd_inode->i_mutex);
>       while (bsize < PAGE_CACHE_SIZE) {
>               if (size & bsize)
>                       break;
> 
> 
> -- 
> Jeff Mahoney
> SUSE Labs
> --
> To unsubscribe from this list: send the line "unsubscribe stable" in
> the body of a message to [email protected]
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe stable" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to