aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/staging/lustre/lustre/mdc/mdc_locks.c
diff options
context:
space:
mode:
authorEmoly Liu <emoly.liu@intel.com>2016-08-16 16:19:13 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-21 15:57:38 +0200
commit099d5adf1ebb1d9d60097ece334930d9dab1bbc9 (patch)
tree7807242582ea65f95c8960faddfbc7318c85a8e4 /drivers/staging/lustre/lustre/mdc/mdc_locks.c
parentstaging: lustre: fld: add fld description documentation (diff)
downloadlinux-dev-099d5adf1ebb1d9d60097ece334930d9dab1bbc9.tar.xz
linux-dev-099d5adf1ebb1d9d60097ece334930d9dab1bbc9.zip
staging: lustre: ldlm: improve ldlm_lock_create() return value
ldlm_lock_create() and ldlm_resource_get() always return NULL as error reporting and "NULL" is interpretted as ENOMEM incorrectly sometimes. This patch fixes this problem by using ERR_PTR() rather than NULL. Signed-off-by: Emoly Liu <emoly.liu@intel.com> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-4524 Reviewed-on: http://review.whamcloud.com/9004 Reviewed-by: Bobi Jam <bobijam@gmail.com> Reviewed-by: Andreas Dilger <andreas.dilger@intel.com> Reviewed-by: John L. Hammond <john.hammond@intel.com> Signed-off-by: James Simmons <jsimmons@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/staging/lustre/lustre/mdc/mdc_locks.c')
-rw-r--r--drivers/staging/lustre/lustre/mdc/mdc_locks.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/staging/lustre/lustre/mdc/mdc_locks.c b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
index 329120136a62..fab83ddeef65 100644
--- a/drivers/staging/lustre/lustre/mdc/mdc_locks.c
+++ b/drivers/staging/lustre/lustre/mdc/mdc_locks.c
@@ -174,7 +174,7 @@ int mdc_null_inode(struct obd_export *exp,
fid_build_reg_res_name(fid, &res_id);
res = ldlm_resource_get(ns, NULL, &res_id, 0, 0);
- if (!res)
+ if (IS_ERR(res))
return 0;
lock_res(res);