Whamcloud - gitweb
LU-6627 mdc: quiet console message for known -EINTR 11/14911/11
authorAndreas Dilger <andreas.dilger@intel.com>
Thu, 21 May 2015 17:58:03 +0000 (11:58 -0600)
committerOleg Drokin <oleg.drokin@intel.com>
Mon, 2 Nov 2015 07:21:53 +0000 (07:21 +0000)
If a user process is waiting for MDS recovery during close, but the
process is interrupted, the file is still closed but it prints a
message on the console.  Quiet the console message for -EINTR, since
this is expected behaviour.

Fix code style issues in this function.

Signed-off-by: Andreas Dilger <andreas.dilger@intel.com>
Change-Id: I3bc7284bb7014dbaeb9bfb27a4e98a8abb4a54b6
Reviewed-on: http://review.whamcloud.com/14911
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Emoly Liu <emoly.liu@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
lustre/llite/file.c

index efec4c0..272292c 100644 (file)
@@ -129,29 +129,25 @@ static void ll_prepare_close(struct inode *inode, struct md_op_data *op_data,
 static int ll_close_inode_openhandle(struct obd_export *md_exp,
                                     struct obd_client_handle *och,
                                     struct inode *inode,
-                                    enum mds_op_bias bias,
-                                    void *data)
+                                    enum mds_op_bias bias, void *data)
 {
-       struct obd_export       *exp = ll_i2mdexp(inode);
-       struct md_op_data       *op_data;
-       struct ptlrpc_request   *req = NULL;
-       struct obd_device       *obd = class_exp2obd(exp);
-       int                      rc;
+       const struct ll_inode_info *lli = ll_i2info(inode);
+       struct md_op_data *op_data;
+       struct ptlrpc_request *req = NULL;
+       int rc;
        ENTRY;
 
-       if (obd == NULL) {
-               /*
-                * XXX: in case of LMV, is this correct to access
-                * ->exp_handle?
-                */
-               CERROR("Invalid MDC connection handle "LPX64"\n",
-                      ll_i2mdexp(inode)->exp_handle.h_cookie);
+       if (class_exp2obd(md_exp) == NULL) {
+               CERROR("%s: invalid MDC connection handle closing "DFID"\n",
+                      ll_get_fsname(inode->i_sb, NULL, 0),
+                      PFID(&lli->lli_fid));
                GOTO(out, rc = 0);
        }
 
        OBD_ALLOC_PTR(op_data);
+       /* We leak openhandle and request here on error, but not much to be
+        * done in OOM case since app won't retry close on error either. */
        if (op_data == NULL)
-               /* XXX We leak openhandle and request here. */
                GOTO(out, rc = -ENOMEM);
 
        ll_prepare_close(inode, op_data, och);
@@ -177,12 +173,10 @@ static int ll_close_inode_openhandle(struct obd_export *md_exp,
                break;
        }
 
-        rc = md_close(md_exp, op_data, och->och_mod, &req);
-       if (rc) {
+       rc = md_close(md_exp, op_data, och->och_mod, &req);
+       if (rc != 0 && rc != -EINTR)
                CERROR("%s: inode "DFID" mdc close failed: rc = %d\n",
-                      ll_i2mdexp(inode)->exp_obd->obd_name,
-                      PFID(ll_inode2fid(inode)), rc);
-       }
+                      md_exp->exp_obd->obd_name, PFID(&lli->lli_fid), rc);
 
        if (rc == 0 &&
            op_data->op_bias & (MDS_HSM_RELEASE | MDS_CLOSE_LAYOUT_SWAP)) {
@@ -201,9 +195,8 @@ out:
        och->och_fh.cookie = DEAD_HANDLE_MAGIC;
        OBD_FREE_PTR(och);
 
-        if (req) /* This is close request */
-                ptlrpc_req_finished(req);
-        return rc;
+       ptlrpc_req_finished(req);       /* This is close request */
+       return rc;
 }
 
 int ll_md_real_close(struct inode *inode, fmode_t fmode)