mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@osdl.org>
To: Alasdair G Kergon <agk@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/10] dm snapshot: unify chunk_size
Date: Thu, 25 May 2006 15:09:14 -0700	[thread overview]
Message-ID: <20060525150914.58fb5106.akpm@osdl.org> (raw)
In-Reply-To: <20060525190639.GS4521@agk.surrey.redhat.com>

Alasdair G Kergon <agk@redhat.com> wrote:
>
>  +	chunk_t chunk_size;

That's a sector_t.  (Bad DM people!  Why not just use sector_t?)

>   	r = chunk_io(ps, 0, READ);
>   	if (r)
>  @@ -210,8 +210,29 @@ static int read_header(struct pstore *ps
>   		*new_snapshot = 0;
>   		ps->valid = le32_to_cpu(dh->valid);
>   		ps->version = le32_to_cpu(dh->version);
>  -		ps->chunk_size = le32_to_cpu(dh->chunk_size);
>  -
>  +		chunk_size = le32_to_cpu(dh->chunk_size);
>  +		if (ps->snap->chunk_size != chunk_size) {
>  +			DMWARN("chunk size %llu in device metadata overrides "
>  +			       "table chunk size of %llu.",
>  +			       (unsigned long long)chunk_size,
>  +			       (unsigned long long)ps->snap->chunk_size);
>  +
>  +			/* We had a bogus chunk_size. Fix stuff up. */
>  +			dm_io_put(sectors_to_pages(ps->snap->chunk_size));
>  +			free_area(ps);
>  +
>  +			ps->snap->chunk_size = chunk_size;
>  +			ps->snap->chunk_mask = chunk_size - 1;
>  +			ps->snap->chunk_shift = ffs(chunk_size) - 1;

but ffs() takes an int.

I guess you weren't planning on chunks larger than 2TB ;)

      reply	other threads:[~2006-05-25 22:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-25 19:06 Alasdair G Kergon
2006-05-25 22:09 ` Andrew Morton [this message]

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=20060525150914.58fb5106.akpm@osdl.org \
    --to=akpm@osdl.org \
    --cc=agk@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®