Joseph Qi
2014-Dec-17 00:50 UTC
[Ocfs2-devel] [PATCH] ocfs2: remove bogus check in dlm_process_recovery_data
In dlm_process_recovery_data, only when dlm_new_lock failed the ret will be set to -ENOMEM. And in this case, newlock is definitely NULL. So test newlock is meaningless, remove it. Signed-off-by: Joseph Qi <joseph.qi at huawei.com> Reviewed-by: Alex Chen <alex.chen at huawei.com> --- fs/ocfs2/dlm/dlmrecovery.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/fs/ocfs2/dlm/dlmrecovery.c b/fs/ocfs2/dlm/dlmrecovery.c index 3365839..a239010 100644 --- a/fs/ocfs2/dlm/dlmrecovery.c +++ b/fs/ocfs2/dlm/dlmrecovery.c @@ -2015,11 +2015,8 @@ leave: dlm_lockres_drop_inflight_ref(dlm, res); spin_unlock(&res->spinlock); - if (ret < 0) { + if (ret < 0) mlog_errno(ret); - if (newlock) - dlm_lock_put(newlock); - } return ret; } -- 1.8.4.3
Mark Fasheh
2014-Dec-19 01:01 UTC
[Ocfs2-devel] [PATCH] ocfs2: remove bogus check in dlm_process_recovery_data
On Wed, Dec 17, 2014 at 08:50:31AM +0800, Joseph Qi wrote:> In dlm_process_recovery_data, only when dlm_new_lock failed the ret > will be set to -ENOMEM. And in this case, newlock is definitely NULL. > So test newlock is meaningless, remove it. > > Signed-off-by: Joseph Qi <joseph.qi at huawei.com> > Reviewed-by: Alex Chen <alex.chen at huawei.com>Reviewed-by: Mark Fasheh <mfasheh at suse.de> --Mark -- Mark Fasheh