From patchwork Sun Dec 24 12:34:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiongwei Song X-Patchwork-Id: 10131949 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CF98960318 for ; Sun, 24 Dec 2017 12:35:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF504204C3 for ; Sun, 24 Dec 2017 12:35:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0F2628BB3; Sun, 24 Dec 2017 12:35:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B4A9204C3 for ; Sun, 24 Dec 2017 12:35:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752692AbdLXMfC (ORCPT ); Sun, 24 Dec 2017 07:35:02 -0500 Received: from mail-pg0-f68.google.com ([74.125.83.68]:40288 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751574AbdLXMfB (ORCPT ); Sun, 24 Dec 2017 07:35:01 -0500 Received: by mail-pg0-f68.google.com with SMTP id k15so16188091pgr.7; Sun, 24 Dec 2017 04:35:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=RbTmNANMe/6CwtsJCgZ4EQS2pSJBqrMvo7jFavutrEE=; b=mm0JNkunHYVS8FJTcD18y4FDa1Y0WW5EfsjVakCfG+j9fLTBKvROSj0mfQ3bkTR+u5 fYiInxgU1i+SP9L9ol+bXPJoWSvpnU5vx6BF+eXp1pE17SExuxClaHIKOGaEdkFfT6sl F3x4QWzBPS/cWocoI1wp8/LNJhBGIqc2qQa13GRpk8cLZpQbHqSFqM1b4UR6yRAVrJ6t G9570tc5MpX8+n6Sn/OamaFVPJNgP+Hp9W5k4S1P8DzGpsibH4VMxo1VjoZO2YGDXVUz WyU+fZUezghd8uc9e/2n69Rb/KhEUH0JOYotSsEs7EYKK/tCd+9NMxow2vXMIVxR3llV sRMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RbTmNANMe/6CwtsJCgZ4EQS2pSJBqrMvo7jFavutrEE=; b=aMVKxQCv4mSxByEiPq6LSFpSQkrQ8mxgoB72BcboXtqCdUYMqL2UA//8ZOiS+X+HiL bSef8o/hU1dcoxHIr2+sVbca62hV60LBFAMzw2qXsbvJe2ksoKVo01zZEfO4JX5khuD1 +9qXNrW4HMINtOmDcTH5G01W9pQ+LIee1qDWBe9xEPoLSu4cUyl1MPmm1VDCSGvbSmnV QOY5ZqXzhyHJqjunLPvv5sUYgDPDnd95KtiFz+h4JFdeeQ2ops93nS8zxWJ9RPtx9AHl eZYQgqm3joqAOjFNDrW6TEhKLO0hFQsB+9Ki48h4yGVBOgxiiVqrWeiG2H9il+I4rQfq EQsA== X-Gm-Message-State: AKGB3mLxqNzixd+XvVyCR95PG51hsHuhTbeOEvEvs/szchXHpikCbDoz I4aU4JQ7g28DLpM3ROFaFcw= X-Google-Smtp-Source: ACJfBot1gMSiTApxls2J/bPZru2AELN9SumRWuVIxMbe6nvm5QlvNMgppkY60yfmm61Pch89gGqvEg== X-Received: by 10.101.86.204 with SMTP id w12mr655854pgs.70.1514118900677; Sun, 24 Dec 2017 04:35:00 -0800 (PST) Received: from localhost.localdomain ([114.244.180.78]) by smtp.gmail.com with ESMTPSA id 65sm38698127pgj.55.2017.12.24.04.34.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 24 Dec 2017 04:35:00 -0800 (PST) From: Xiongwei Song To: darrick.wong@oracle.com, linux-xfs@vger.kernel.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH] xfs: destroy mutex qi_tree_lock before free xfs_quotainfo_t object Date: Sun, 24 Dec 2017 20:34:47 +0800 Message-Id: <20171224123447.2998-1-sxwjean@gmail.com> X-Mailer: git-send-email 2.15.1 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The mutex qi_tree_lock of xfs_quotainfo_t object was initialized when calling xfs_qm_init_quotainfo, but it was not destroyed before free xfs_quotainfo_t object when calling xfs_qm_destroy_quotainfo, this was incorrect, so destroy it in function xfs_qm_destroy_quotainfo. Signed-off-by: Xiongwei Song --- fs/xfs/xfs_qm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c index ec952dfad359..deceef5cbbf3 100644 --- a/fs/xfs/xfs_qm.c +++ b/fs/xfs/xfs_qm.c @@ -737,6 +737,7 @@ xfs_qm_destroy_quotainfo( qi->qi_pquotaip = NULL; } mutex_destroy(&qi->qi_quotaofflock); + mutex_destroy(&qi->qi_tree_lock); kmem_free(qi); mp->m_quotainfo = NULL; }