Whamcloud - gitweb
Merge b_md to HEAD for 0.5.19 release.
[fs/lustre-release.git] / lustre / llite / symlink.c
index a89ca2a..5be4717 100644 (file)
@@ -89,24 +89,28 @@ static int ll_follow_link(struct dentry *dentry, struct nameidata *nd,
         struct inode *inode = dentry->d_inode;
         struct ll_inode_info *lli = ll_i2info(inode);
         struct ptlrpc_request *request;
-        int op, mode;
+        int op = 0, mode = 0, rc;
         char *symname;
-        int rc;
         ENTRY;
 
-        op = it->it_op;
-        mode = it->it_mode;
+        if (it != NULL) {
+                op = it->it_op;
+                mode = it->it_mode;
 
-        ll_intent_release(dentry, it);
-        down(&lli->lli_open_sem);
+                ll_intent_release(dentry, it);
+        }
 
-        it->it_op = op;
-        it->it_mode = mode;
+        down(&lli->lli_open_sem);
 
         rc = ll_readlink_internal(inode, &request, &symname);
         if (rc)
                 GOTO(out, rc);
 
+        if (it != NULL) {
+                it->it_op = op;
+                it->it_mode = mode;
+        }
+
         rc = vfs_follow_link_it(nd, symname, it);
  out:
         up(&lli->lli_open_sem);