From 94eb8dabc3c3273fd5cc54cb89522568f7e94b34 Mon Sep 17 00:00:00 2001 From: lsy Date: Fri, 13 Oct 2006 12:54:18 +0000 Subject: [PATCH] use mdt_body->size instead of mdt_body->flags to store errno, whose type is __u64, thus can transfer negative value between 32 and 64 platform. --- lustre/mdc/mdc_request.c | 4 ++-- lustre/mdt/mdt_handler.c | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lustre/mdc/mdc_request.c b/lustre/mdc/mdc_request.c index 549a86e..f408a6a 100644 --- a/lustre/mdc/mdc_request.c +++ b/lustre/mdc/mdc_request.c @@ -1629,8 +1629,8 @@ static int mdc_interpret_renew_capa(struct ptlrpc_request *req, void *unused, if (body == NULL) GOTO(out, capa = ERR_PTR(-EFAULT)); - if (body->flags) - GOTO(out, capa = ERR_PTR((long)body->flags)); + if (body->size) + GOTO(out, capa = ERR_PTR((long)body->size)); if ((body->valid & OBD_MD_FLOSSCAPA) == 0) GOTO(out, capa = ERR_PTR(-EFAULT)); diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index 35cc2fe..1ca3fdc 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -459,7 +459,12 @@ static int mdt_renew_capa(struct mdt_thread_info *info) body->valid |= OBD_MD_FLOSSCAPA; EXIT; out: - body->flags = (__u32)rc; + /* NB: capability renewal might fail because object has been removed, + * or server has disabled capability, but this is not error, llite + * will handle this internally, see mdc_interpret_renew_capa. + * body->size is borrowed to store errno. + */ + body->size = (__u64)rc; return 0; } -- 1.8.3.1