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:
pjd 2010-09-23 10:58:13 +00:00
parent 08e51b6267
commit c7c339d606

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