Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966286AbdGUCIS (ORCPT ); Thu, 20 Jul 2017 22:08:18 -0400 Received: from mxhk.zte.com.cn ([63.217.80.70]:13905 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965967AbdGUCIQ (ORCPT ); Thu, 20 Jul 2017 22:08:16 -0400 X-scanvirus: By SEG_CYREN AntiVirus Engine X-scanresult: CLEAN X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 From: Wang Xibo To: swhiteho@redhat.com, rpeterso@redhat.com Cc: cluster-devel@redhat.com, linux-kernel@vger.kernel.org, wang.xibo@zte.com.cn, Xiao Likun Subject: [PATCH] GFS2: fix code parameter error in inode_go_lock Date: Sat, 22 Jul 2017 02:27:28 +0800 Message-Id: <1500661648-3650-1-git-send-email-wang.xibo@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-07-21 10:08:11, Serialize by Router on notes_smtp/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2017-07-21 10:07:50, Serialize complete at 2017-07-21 10:07:50 X-MAIL: mse01.zte.com.cn v6L286tv097311 X-HQIP: 127.0.0.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 956 Lines: 27 In inode_go_lock() function, the parameter order of list_add() is error. According to the define of list_add(), the first parameter is new entry and the second is the list head, so ip->i_trunc_list should be the first parameter and the sdp->sd_trunc_list should be second. Signed-off-by: Wang Xibo Signed-off-by: Xiao Likun --- fs/gfs2/glops.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/gfs2/glops.c b/fs/gfs2/glops.c index 5e69636..28c203a 100644 --- a/fs/gfs2/glops.c +++ b/fs/gfs2/glops.c @@ -470,7 +470,7 @@ static int inode_go_lock(struct gfs2_holder *gh) (gh->gh_state == LM_ST_EXCLUSIVE)) { spin_lock(&sdp->sd_trunc_lock); if (list_empty(&ip->i_trunc_list)) - list_add(&sdp->sd_trunc_list, &ip->i_trunc_list); + list_add(&ip->i_trunc_list, &sdp->sd_trunc_list); spin_unlock(&sdp->sd_trunc_lock); wake_up(&sdp->sd_quota_wait); return 1; -- 1.8.3.1