linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@clusterfs.com>
To: tytso@mit.edu
Cc: torvalds@transmeta.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] loop device broken in 2.5.38
Date: Wed, 25 Sep 2002 12:03:55 -0600	[thread overview]
Message-ID: <20020925180355.GD22795@clusterfs.com> (raw)
In-Reply-To: <E17uG42-0002gm-00@think.thunk.org>

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/


  reply	other threads:[~2002-09-25 18:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-09-25 17:35 [PATCH] loop device broken in 2.5.38 tytso
2002-09-25 18:03 ` Andreas Dilger [this message]
2002-09-25 20:12   ` Theodore Ts'o

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20020925180355.GD22795@clusterfs.com \
    --to=adilger@clusterfs.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    --cc=tytso@mit.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).