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

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