mirror of
https://github.com/ceph/ceph
synced 2025-01-11 05:29:51 +00:00
rbdtool: fix export
Signed-off-by: Sage Weil <sage@newdream.net>
This commit is contained in:
parent
1e08e4bf1f
commit
ae82dd5a5c
@ -580,22 +580,19 @@ static int do_export(pool_t pool, string& md_oid, const char *path)
|
||||
goto done;
|
||||
}
|
||||
|
||||
pos += block_size;
|
||||
|
||||
if (bl.length()) {
|
||||
ret = lseek64(fd, pos, SEEK_SET);
|
||||
if (ret < 0) {
|
||||
ret = -errno;
|
||||
cerr << "could not seek to pos " << pos << std::endl;
|
||||
goto done;
|
||||
}
|
||||
ret = write(fd, bl.c_str(), bl.length());
|
||||
if (ret < 0)
|
||||
goto done;
|
||||
|
||||
if (bl.length() < block_size) {
|
||||
ret = lseek64(fd, pos, SEEK_SET);
|
||||
if (ret < 0) {
|
||||
ret = -errno;
|
||||
cerr << "could not seek to pos " << pos << std::endl;
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pos += block_size;
|
||||
}
|
||||
r = ftruncate(fd, header.image_size);
|
||||
if (r < 0)
|
||||
|
Loading…
Reference in New Issue
Block a user