Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Feb 2013 10:02:26 +0000 (UTC)
From:      Edward Tomasz Napierala <trasz@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r246236 - stable/9/sbin/growfs
Message-ID:  <201302021002.r12A2QnC097415@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: trasz
Date: Sat Feb  2 10:02:26 2013
New Revision: 246236
URL: http://svnweb.freebsd.org/changeset/base/246236

Log:
  MFC r244243:
  
  Fix extending filesystems of weird size by making sure the actual size
  is always multiple of fragment size.

Modified:
  stable/9/sbin/growfs/growfs.c
Directory Properties:
  stable/9/sbin/growfs/   (props changed)

Modified: stable/9/sbin/growfs/growfs.c
==============================================================================
--- stable/9/sbin/growfs/growfs.c	Sat Feb  2 10:00:46 2013	(r246235)
+++ stable/9/sbin/growfs/growfs.c	Sat Feb  2 10:02:26 2013	(r246236)
@@ -1486,6 +1486,12 @@ main(int argc, char **argv)
 		}
 	}
 
+	/*
+	 * Make sure the new size is a multiple of fs_fsize; /dev/ufssuspend
+	 * only supports fragment-aligned IO requests.
+	 */
+	size -= size % osblock.fs_fsize;
+
 	if (size <= (uint64_t)(osblock.fs_size * osblock.fs_fsize)) {
 		humanize_number(oldsizebuf, sizeof(oldsizebuf),
 		    osblock.fs_size * osblock.fs_fsize,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201302021002.r12A2QnC097415>