linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] i_blkbits inconsistency
@ 2002-10-25 21:01 Hugh Dickins
  2002-10-25 21:38 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Hugh Dickins @ 2002-10-25 21:01 UTC (permalink / raw)
  To: Alexander Viro; +Cc: Andrew Morton, Adam J. Richter, linux-kernel

Fix premature -EIO from blkdev_get_block: bdget initialize bd_block_size
consistent with bd_inode->i_blkbits (assigned by new_inode).  Otherwise,
subsequent set_blocksize can find bd_block_size doesn't need updating,
and skip updating i_blkbits, leaving them inconsistent.

--- 2.5.44/fs/block_dev.c	Sat Oct 19 07:14:45 2002
+++ linux/fs/block_dev.c	Fri Oct 25 21:30:41 2002
@@ -310,6 +310,7 @@
 			new_bdev->bd_queue = NULL;
 			new_bdev->bd_contains = NULL;
 			new_bdev->bd_inode = inode;
+			new_bdev->bd_block_size = (1 << inode->i_blkbits);
 			new_bdev->bd_part_count = 0;
 			new_bdev->bd_invalidated = 0;
 			inode->i_mode = S_IFBLK;


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] i_blkbits inconsistency
  2002-10-25 21:01 [PATCH] i_blkbits inconsistency Hugh Dickins
@ 2002-10-25 21:38 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2002-10-25 21:38 UTC (permalink / raw)
  To: Hugh Dickins; +Cc: Alexander Viro, Adam J. Richter, linux-kernel

Hugh Dickins wrote:
> 
> Fix premature -EIO from blkdev_get_block: bdget initialize bd_block_size
> consistent with bd_inode->i_blkbits (assigned by new_inode).  Otherwise,
> subsequent set_blocksize can find bd_block_size doesn't need updating,
> and skip updating i_blkbits, leaving them inconsistent.
> 
> --- 2.5.44/fs/block_dev.c       Sat Oct 19 07:14:45 2002
> +++ linux/fs/block_dev.c        Fri Oct 25 21:30:41 2002
> @@ -310,6 +310,7 @@
>                         new_bdev->bd_queue = NULL;
>                         new_bdev->bd_contains = NULL;
>                         new_bdev->bd_inode = inode;
> +                       new_bdev->bd_block_size = (1 << inode->i_blkbits);
>                         new_bdev->bd_part_count = 0;
>                         new_bdev->bd_invalidated = 0;
>                         inode->i_mode = S_IFBLK;

Thanks, sleuth.   Wondering if we can we remove bd_block_size
and simply use (1 << bdev->bd_inode->i_blkbits) everywhere?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-10-25 21:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-25 21:01 [PATCH] i_blkbits inconsistency Hugh Dickins
2002-10-25 21:38 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).