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
This commit is contained in:
Pawel Jakub Dawidek 2010-09-23 10:58:13 +00:00
parent 429cf66400
commit 2ecb2a01e7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=213058

View File

@ -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) {