From patchwork Mon Aug 21 11:55:00 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Kara X-Patchwork-Id: 9912335 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 8D680602D8 for ; Mon, 21 Aug 2017 11:56:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7689927FA8 for ; Mon, 21 Aug 2017 11:56:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B703286E4; Mon, 21 Aug 2017 11:56:28 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 2857727FA8 for ; Mon, 21 Aug 2017 11:56:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753780AbdHUL4Z (ORCPT ); Mon, 21 Aug 2017 07:56:25 -0400 Received: from mx2.suse.de ([195.135.220.15]:32875 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753522AbdHULzW (ORCPT ); Mon, 21 Aug 2017 07:55:22 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 7CD76AC94; Mon, 21 Aug 2017 11:55:19 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id E0DB21E3442; Mon, 21 Aug 2017 13:55:18 +0200 (CEST) From: Jan Kara To: Cc: Wang Shilong , Andreas Dilger , Jan Kara Subject: [PATCH 10/27] quota: Remove locking for writing to the old quota format Date: Mon, 21 Aug 2017 13:55:00 +0200 Message-Id: <20170821115517.26542-11-jack@suse.cz> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20170821115517.26542-1-jack@suse.cz> References: <20170821115517.26542-1-jack@suse.cz> Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The old quota quota format has fixed offset in quota file based on ID so there's no locking needed against concurrent modifications of the file (locking against concurrent IO on the same dquot is still provided by dq_lock). Reviewed-by: Andreas Dilger Signed-off-by: Jan Kara --- fs/quota/quota_v1.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/fs/quota/quota_v1.c b/fs/quota/quota_v1.c index 94cceb76b9a3..12d69cda57cc 100644 --- a/fs/quota/quota_v1.c +++ b/fs/quota/quota_v1.c @@ -83,9 +83,7 @@ static int v1_commit_dqblk(struct dquot *dquot) short type = dquot->dq_id.type; ssize_t ret; struct v1_disk_dqblk dqblk; - struct quota_info *dqopt = sb_dqopt(dquot->dq_sb); - down_write(&dqopt->dqio_sem); v1_mem2disk_dqblk(&dqblk, &dquot->dq_dqb); if (((type == USRQUOTA) && uid_eq(dquot->dq_id.uid, GLOBAL_ROOT_UID)) || ((type == GRPQUOTA) && gid_eq(dquot->dq_id.gid, GLOBAL_ROOT_GID))) { @@ -99,7 +97,6 @@ static int v1_commit_dqblk(struct dquot *dquot) ret = dquot->dq_sb->s_op->quota_write(dquot->dq_sb, type, (char *)&dqblk, sizeof(struct v1_disk_dqblk), v1_dqoff(from_kqid(&init_user_ns, dquot->dq_id))); - up_write(&dqopt->dqio_sem); if (ret != sizeof(struct v1_disk_dqblk)) { quota_error(dquot->dq_sb, "dquota write failed"); if (ret >= 0)