diff options
author | pjd <pjd@FreeBSD.org> | 2010-09-23 10:58:13 +0000 |
---|---|---|
committer | pjd <pjd@FreeBSD.org> | 2010-09-23 10:58:13 +0000 |
commit | c7c339d606a95a68348f32c3ee5f9c4c73890065 (patch) | |
tree | 230b4d6dad61182be5df53de29880f73ed0411d5 /sbin/geom/class | |
parent | 08e51b6267f6ef958962ee928786256f573c3dd2 (diff) | |
download | FreeBSD-src-c7c339d606a95a68348f32c3ee5f9c4c73890065.zip FreeBSD-src-c7c339d606a95a68348f32c3ee5f9c4c73890065.tar.gz |
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
Diffstat (limited to 'sbin/geom/class')
-rw-r--r-- | sbin/geom/class/eli/geom_eli.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sbin/geom/class/eli/geom_eli.c b/sbin/geom/class/eli/geom_eli.c index 3b591fe..1f9b9c8 100644 --- a/sbin/geom/class/eli/geom_eli.c +++ b/sbin/geom/class/eli/geom_eli.c @@ -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) { |