[sheepdog] [PATCH] sheep: invalidate inode status of other nodes before actual write
YAMADA Hideki
yamada.hideki at lab.ntt.co.jp
Wed Nov 5 07:36:13 CET 2014
This patch seems to work well.
I tested iSCSI multipath failover while writing,
and it succeeded in combination with following tgt patch.
http://article.gmane.org/gmane.linux.stgt/392
Tested-by: YAMADA Hideki <yamada.hideki at lab.ntt.co.jp>
On 2014/11/05 15:06, Hitoshi Mitake wrote:
> Current iscsi coherence protocol can cause inconsistency when a
> gateway sheep process dies between inode update and invalidation.
>
> This patch makes sure that inode update must cause invalidation even
> if sheep dies before actual inode.
>
> Cc: YAMADA Hideki <yamada.hideki at lab.ntt.co.jp>
> Signed-off-by: Hitoshi Mitake <mitake.hitoshi at lab.ntt.co.jp>
> ---
> sheep/gateway.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/sheep/gateway.c b/sheep/gateway.c
> index a5cee5c..7f7d1d1 100644
> --- a/sheep/gateway.c
> +++ b/sheep/gateway.c
> @@ -681,6 +681,9 @@ int gateway_write_obj(struct request *req)
> if (!bypass_object_cache(req))
> return object_cache_handle_request(req);
>
> + if (is_data_vid_update(hdr))
> + invalidate_other_nodes(oid_to_vid(oid));
> +
> if (is_data_vid_update(hdr)) {
> size_t nr_vids = hdr->data_length / sizeof(*vids);
>
> @@ -701,8 +704,6 @@ int gateway_write_obj(struct request *req)
> update_obj_refcnt(hdr, vids, new_vids, refs);
> }
> out:
> - if (is_data_vid_update(hdr))
> - invalidate_other_nodes(oid_to_vid(oid));
>
> free(vids);
> free(refs);
>
More information about the sheepdog
mailing list