[sheepdog] [PATCH 3/3] fix error-io in sheepfs when using ext4 filesystem
Robin Dong
robin.k.dong at gmail.com
Thu Aug 22 11:51:03 CEST 2013
From: Robin Dong <sanbai at taobao.com>
When using ext4 filesystem on sheepfs volumes, it will print kern message:
[171972.794292] io-error-guard: catch 1 continuous bio error.
[171977.699795] io-error-guard: catch 2 continuous bio errors.
[171977.707797] Aborting journal on device loop0-8.
[171978.162038] EXT4-fs error (device loop0): ext4_journal_start_sb: Detected aborted journal
[171978.170034] EXT4-fs (loop0): Remounting filesystem read-only
The reason is sheepfs process FLUSH opcode incorrectly. If the sheep daemon dose not
support FLUSH, sheepfs should explicitly set sheepfs_object_cache to 'false' and return
success, not return error.
Signed-off-by: Robin Dong <sanbai at taobao.com>
---
sheepfs/volume.c | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/sheepfs/volume.c b/sheepfs/volume.c
index 99aaf81..ca8925a 100644
--- a/sheepfs/volume.c
+++ b/sheepfs/volume.c
@@ -277,11 +277,17 @@ static int volume_do_sync(uint32_t vid)
ret = exec_req(fd, &hdr, NULL, NULL, 0, MAX_RETRY_COUNT);
put_socket_fd(vdi, idx);
+ /* if sheep daemon does not support FLUSH */
+ if (rsp->result == SD_RES_INVALID_PARMS) {
+ sheepfs_object_cache = false;
+ goto out;
+ }
+
if (ret || rsp->result != SD_RES_SUCCESS) {
sheepfs_pr("failed to flush vdi %"PRIx32"\n", vid);
return -1;
}
-
+out:
return 0;
}
--
1.7.3.2
More information about the sheepdog
mailing list