lustre/mdc: fix bad ERR_PTR usage in mdc_locks.c
In mdc_intent_open_pack() return an ERR_PTR() rather than NULL when ldlm_prep_enqueue_req() fails. In mdc_intent_getattr_async() check the return value of mdc_intent_getattr_pack() using IS_ERR(). Clean up the includes in mdc_locks.c. Signed-off-by: John L. Hammond <john.hammond@intel.com> Reviewed-on: http://review.whamcloud.com/7886 Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4078 Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: Nathaniel Clark <nathaniel.l.clark@intel.com> Signed-off-by: Oleg Drokin <oleg.drokin@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
ec9bca9c51
commit
add882a8b5
1 changed files with 10 additions and 10 deletions
|
@ -37,15 +37,15 @@
|
||||||
#define DEBUG_SUBSYSTEM S_MDC
|
#define DEBUG_SUBSYSTEM S_MDC
|
||||||
|
|
||||||
# include <linux/module.h>
|
# include <linux/module.h>
|
||||||
# include <linux/pagemap.h>
|
|
||||||
# include <linux/miscdevice.h>
|
|
||||||
|
|
||||||
#include <lustre_acl.h>
|
#include <linux/lustre_intent.h>
|
||||||
|
#include <obd.h>
|
||||||
#include <obd_class.h>
|
#include <obd_class.h>
|
||||||
#include <lustre_dlm.h>
|
#include <lustre_dlm.h>
|
||||||
/* fid_res_name_eq() */
|
#include <lustre_fid.h> /* fid_res_name_eq() */
|
||||||
#include <lustre_fid.h>
|
#include <lustre_mdc.h>
|
||||||
#include <lprocfs_status.h>
|
#include <lustre_net.h>
|
||||||
|
#include <lustre_req_layout.h>
|
||||||
#include "mdc_internal.h"
|
#include "mdc_internal.h"
|
||||||
|
|
||||||
struct mdc_getattr_args {
|
struct mdc_getattr_args {
|
||||||
|
@ -336,9 +336,9 @@ static struct ptlrpc_request *mdc_intent_open_pack(struct obd_export *exp,
|
||||||
max(lmmsize, obddev->u.cli.cl_default_mds_easize));
|
max(lmmsize, obddev->u.cli.cl_default_mds_easize));
|
||||||
|
|
||||||
rc = ldlm_prep_enqueue_req(exp, req, &cancels, count);
|
rc = ldlm_prep_enqueue_req(exp, req, &cancels, count);
|
||||||
if (rc) {
|
if (rc < 0) {
|
||||||
ptlrpc_request_free(req);
|
ptlrpc_request_free(req);
|
||||||
return NULL;
|
return ERR_PTR(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_lock(&req->rq_lock);
|
spin_lock(&req->rq_lock);
|
||||||
|
@ -1281,8 +1281,8 @@ int mdc_intent_getattr_async(struct obd_export *exp,
|
||||||
|
|
||||||
fid_build_reg_res_name(&op_data->op_fid1, &res_id);
|
fid_build_reg_res_name(&op_data->op_fid1, &res_id);
|
||||||
req = mdc_intent_getattr_pack(exp, it, op_data);
|
req = mdc_intent_getattr_pack(exp, it, op_data);
|
||||||
if (!req)
|
if (IS_ERR(req))
|
||||||
return -ENOMEM;
|
return PTR_ERR(req);
|
||||||
|
|
||||||
rc = mdc_enter_request(&obddev->u.cli);
|
rc = mdc_enter_request(&obddev->u.cli);
|
||||||
if (rc != 0) {
|
if (rc != 0) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue