All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Sandeen <sandeen@sandeen.net>
To: Chris Wedgwood <cw@f00f.org>
Cc: Matthias Schniedermeyer <ms@citd.de>,
	xfs@oss.sgi.com, Barry Naujok <bnaujok@sgi.com>
Subject: Re: mkfs.xfs doesn't detect size of storage correctly
Date: Tue, 29 Jan 2008 15:21:00 -0600	[thread overview]
Message-ID: <479F98BC.6060507@sandeen.net> (raw)
In-Reply-To: <20080129203731.GA29094@puku.stupidest.org>

Chris Wedgwood wrote:
> On Tue, Jan 29, 2008 at 02:14:50PM -0600, Eric Sandeen wrote:
>
>   
>> [root@magnesium tmp]# mkfs.xfs -dfile,name=xfsfile,size=750156369920
>>     
>
> I see this too except I'm pre-creating a file of the right length:
>
> -rw-r--r-- 1 root root 750156369920 Jan 29 12:35 xfsfile
>
> [...]
>
> /root/xfsfile  xfs    524G  4.2M  524G   1% /mnt/tmp
>
>   
I think this fixes it, but it was just a quickie so pls double check :)

if agcount * agsize <= dblocks, then the last ag shouldn't be "small"

-Eric

Index: xfsprogs-2.9.5/mkfs/xfs_mkfs.c
===================================================================
--- xfsprogs-2.9.5.orig/mkfs/xfs_mkfs.c
+++ xfsprogs-2.9.5/mkfs/xfs_mkfs.c
@@ -523,7 +523,8 @@ validate_ag_geometry(
 	 * If the last AG is too small, reduce the filesystem size
 	 * and drop the blocks.
 	 */
-	if ( dblocks % agsize != 0 &&
+	if ( agcount * agsize > dblocks &&
+	     dblocks % agsize != 0 &&
 	     (dblocks % agsize < XFS_AG_MIN_BLOCKS(blocklog))) {
 		fprintf(stderr,
 	_("last AG size %lld blocks too small, minimum size is %lld blocks\n"),
@@ -1808,7 +1809,8 @@ _("size %s specified for log subvolume i
 	 * If the last AG is too small, reduce the filesystem size
 	 * and drop the blocks.
 	 */
-	if ( dblocks % agsize != 0 &&
+	if ( agcount * agsize > dblocks &&
+	     dblocks % agsize != 0 &&
 	     (dblocks % agsize < XFS_AG_MIN_BLOCKS(blocklog))) {
 		dblocks = (xfs_drfsbno_t)((agcount - 1) * agsize);
 		agcount--;

  parent reply	other threads:[~2008-01-29 21:21 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-29  9:32 mkfs.xfs doesn't detect size of storage correctly Matthias Schniedermeyer
2008-01-29 10:15 ` nscott
2008-01-29 12:20   ` Matthias Schniedermeyer
2008-01-29 15:19     ` Eric Sandeen
2008-01-29 15:33       ` Matthias Schniedermeyer
2008-01-29 15:42         ` Eric Sandeen
2008-01-29 16:58           ` Matthias Schniedermeyer
2008-01-29 17:16 ` Matthias Schniedermeyer
2008-01-29 20:14   ` Eric Sandeen
     [not found]     ` <20080129203731.GA29094@puku.stupidest.org>
2008-01-29 21:21       ` Eric Sandeen [this message]
2008-01-30 23:26   ` Matthias Schniedermeyer
2008-01-31  3:17     ` Eric Sandeen
2008-02-05 14:53 ` Eric Sandeen
2008-02-05 15:33   ` Matthias Schniedermeyer
2008-02-05 21:12   ` Mark Goodwin

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=479F98BC.6060507@sandeen.net \
    --to=sandeen@sandeen.net \
    --cc=bnaujok@sgi.com \
    --cc=cw@f00f.org \
    --cc=ms@citd.de \
    --cc=xfs@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.