Whamcloud - gitweb
LU-3373 llite: instantiate negative dentry 10/8110/4
authoryangsheng <yang.sheng@intel.com>
Wed, 13 Nov 2013 13:30:35 +0000 (21:30 +0800)
committerOleg Drokin <oleg.drokin@intel.com>
Thu, 5 Dec 2013 16:34:58 +0000 (16:34 +0000)
In the atomic_open callback. We should instantiate
negative dentry. Else will got sanity:183 failed.

Signed-off-by: yang sheng <yang.sheng@intel.com>
Change-Id: I83bc4a8995dfb813a381e910cc94cef6fe3721c3
Reviewed-on: http://review.whamcloud.com/8110
Tested-by: Jenkins
Reviewed-by: Peng Tao <bergwolf@gmail.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: James Simmons <uja.ornl@gmail.com>
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Bob Glossman <bob.glossman@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/namei.c

index 4c5dfe7..8876711 100644 (file)
@@ -475,6 +475,12 @@ int ll_lookup_it_finish(struct ptlrpc_request *request,
                if (IS_ERR(alias))
                        RETURN(PTR_ERR(alias));
                *de = alias;
                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)) {
        }
 
        if (!it_disposition(it, DISP_LOOKUP_NEG)) {