GFS2: fix code parameter error in inode_go_lock
authorWang Xibo <wang.xibo@zte.com.cn>
Fri, 21 Jul 2017 12:40:59 +0000 (07:40 -0500)
committerBob Peterson <rpeterso@redhat.com>
Fri, 21 Jul 2017 12:40:59 +0000 (07:40 -0500)
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<wang.xibo@zte.com.cn>
Signed-off-by: Xiao Likun<xiao.likun@zte.com.cn>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
fs/gfs2/glops.c

index 5e69636d4dd3cfd968fa5617f9d93fb1b5f62ada..28c203a029607c1f758518d15ab57f4a567a0a1f 100644 (file)
@@ -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;