Date: Thu, 23 Sep 2010 10:58:13 +0000 (UTC) From: Pawel Jakub Dawidek <pjd@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r213058 - head/sbin/geom/class/eli Message-ID: <201009231058.o8NAwDUo066672@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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) {
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009231058.o8NAwDUo066672>