svn commit: r213058 - head/sbin/geom/class/eli
Pawel Jakub Dawidek
pjd at FreeBSD.org
Thu Sep 23 10:58:13 UTC 2010
Author: pjd
Date: Thu Sep 23 10:58:13 2010
New Revision: 213058
URL: http://svn.freebsd.org/changeset/base/213058
Log:
Because we first write metadata into new place and then trash old place we
don't want situation where old size is equal to new size, as we will trash
newly written metadata.
MFC after: 1 week
Modified:
head/sbin/geom/class/eli/geom_eli.c
Modified: head/sbin/geom/class/eli/geom_eli.c
==============================================================================
--- head/sbin/geom/class/eli/geom_eli.c Thu Sep 23 10:55:45 2010 (r213057)
+++ head/sbin/geom/class/eli/geom_eli.c Thu Sep 23 10:58:13 2010 (r213058)
@@ -1302,6 +1302,10 @@ eli_resize(struct gctl_req *req)
gctl_error(req, "Invalid oldsize: Out of range.");
goto out;
}
+ if (oldsize == mediasize) {
+ gctl_error(req, "Size hasn't changed.");
+ goto out;
+ }
/* Read metadata from the 'oldsize' offset. */
if (pread(provfd, sector, secsize, oldsize - secsize) != secsize) {
More information about the svn-src-all
mailing list