[PATCH 3/5] lustre: instantiate negative dentry

From: Oleg Drokin
Date: Sun Feb 09 2014 - 02:52:35 EST


From: yang sheng <yang.sheng@xxxxxxxxx>

In the atomic_open callback. We should instantiate
negative dentry. Else will got sanity:183 failed.

Signed-off-by: yang sheng <yang.sheng@xxxxxxxxx>
Reviewed-on: http://review.whamcloud.com/8110
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-3228
Reviewed-by: Peng Tao <bergwolf@xxxxxxxxx>
Reviewed-by: Lai Siyao <lai.siyao@xxxxxxxxx>
Reviewed-by: James Simmons <uja.ornl@xxxxxxxxx>
Reviewed-by: Bob Glossman <bob.glossman@xxxxxxxxx>
Reviewed-by: Oleg Drokin <oleg.drokin@xxxxxxxxx>
Signed-off-by: Oleg Drokin <oleg.drokin@xxxxxxxxx>
---
drivers/staging/lustre/lustre/llite/namei.c | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/drivers/staging/lustre/lustre/llite/namei.c b/drivers/staging/lustre/lustre/llite/namei.c
index 8938d37..93c3744 100644
--- a/drivers/staging/lustre/lustre/llite/namei.c
+++ b/drivers/staging/lustre/lustre/llite/namei.c
@@ -468,6 +468,12 @@ int ll_lookup_it_finish(struct ptlrpc_request *request,
if (IS_ERR(alias))
return PTR_ERR(alias);
*de = alias;
+ } else if (!it_disposition(it, DISP_LOOKUP_NEG) &&
+ !it_disposition(it, DISP_OPEN_CREATE)) {
+ /* With DISP_OPEN_CREATE dentry will
+ instantiated in ll_create_it. */
+ LASSERT((*de)->d_inode == NULL);
+ d_instantiate(*de, inode);
}

if (!it_disposition(it, DISP_LOOKUP_NEG)) {
--
1.8.5.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/