[sheepdog] [PATCH stable-0.7 1/2] fix error-io in sheepfs when using ext4 filesystem

Hitoshi Mitake mitake.hitoshi at gmail.com
Mon Aug 26 16:43:10 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>
Signed-off-by: Liu Yuan <namei.unix at gmail.com>
---
 sheepfs/volume.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/sheepfs/volume.c b/sheepfs/volume.c
index 0558639..221c4a2 100644
--- a/sheepfs/volume.c
+++ b/sheepfs/volume.c
@@ -302,11 +302,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.8.1.2




More information about the sheepdog mailing list