lkml.org 
[lkml]   [2002]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] loop device broken in 2.5.38
On Sep 25, 2002  13:35 -0400, tytso@mit.edu wrote:
> The loop device driver was broken in 2.5.38 when it was converted over
> to use gendisk. I discovered this while doing final regression testing
> on the ext3 htree code.
>
> The problem is that figure_loop_size() is setting the capacity of the
> loop device in kilobytes (because that's what compute_loop_size()
> returns), but set_capacity() expects the size in 512 byte sectors.
>
> I've enclosed a patch which fixes the problem, as well as simplifying
> the code by eliminating compute_loop_size(), since it is a static
> function is only used once by figure_loop_size().

Is there a historic reason why we pre-compute and store the loop device
size instead of re-calculating it each time we do a BLKGETSZ ioctl?
Re-calculating it each time allows you to increase the size of the
backing file if needed while it is in use, and I don't think we actually
get the size of the loop device very often, so it is not a big deal,
especially given the simple calculation needed.

Cheers, Andreas
--
Andreas Dilger
http://www-mddsp.enel.ucalgary.ca/People/adilger/
http://sourceforge.net/projects/ext2resize/

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:29    [W:0.126 / U:0.452 seconds]
©2003-2014 Jasper Spaans. Advertise on this site