Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp852164ybi; Fri, 12 Jul 2019 05:43:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwQoh5WSHEQLREp0a63XGL0HiXXY7oYOJt7Jgsba2c4xVvcM5MpJHVE+siQLvlkkCJovE4M X-Received: by 2002:a17:90a:b394:: with SMTP id e20mr11490221pjr.76.1562935401961; Fri, 12 Jul 2019 05:43:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562935401; cv=none; d=google.com; s=arc-20160816; b=cc7Et0yqrUnpdRl2uBOo3+RE0QlzGcu+FF464M5Alot7QLsAO4BFsiG+luW8dttXou LpJbmmEdn8R0XfCurVNFUxPTO7PMjymzA3iYy3nebBLkCTChBDXYfTonHiIRh7Zu9Y6g Hy2rhGS3XWq4mb9+zdfPfwGgxpDYGv8pcMTMsyvDYZax6J8G+7u96Mr77OXJ2zme8wzn 2ZEkvXqMKg6MUyDjYrG2mBDQMim2vLPRGDitBDDRBMQnJ3EKUa/arU0ltGSBBlmebfdX YHhoeoSegYlmOPnFmIDLjBGeM694M3syUJ8RoM5pgEBbUIUQekyI7kSc7krnFb3c8Pvr a3ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=/730OKDF67reUmMR75j0ysz5EssUxp8DORQOfKSUXUE=; b=Jm7sYWrfUppVhyi5We+gPlr6zIHxYNc7++QFC/8o1UNd6/pyIgtcjBU6pym7fVK9HI mEBayL5DHa5baUdWK/jPq3V4+48Hvv9CvjVdKr30C0JCsrofGmdG87kQ79OcerzzMhlY A2t4/1Iph7n/VavqKkanG7tpviPUf+p49tEkk9GG2x+krBHrPlxr/WbOzOZpGK7eclGq GMDgIjyHsTYSq9/ZOw3LMF4ezSuJeF2msbexe0P8d2XQVlrQnPV7D004tpdhmlOkB0w1 0W6XX89dOGTiq0SZTSNASRqviwAYpMDBVAPVQhuchwh78sPrXIXd8sBKN8juhIsYNKld 3yeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qJ3hPk+y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si7599881plp.296.2019.07.12.05.43.06; Fri, 12 Jul 2019 05:43:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qJ3hPk+y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727645AbfGLMkz (ORCPT + 99 others); Fri, 12 Jul 2019 08:40:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:33724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727473AbfGLMYo (ORCPT ); Fri, 12 Jul 2019 08:24:44 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0E22E2084B; Fri, 12 Jul 2019 12:24:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562934283; bh=/Jar8IeLznHx4REKRYSjt26qWLrEXBuOcKDnIMhnuzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qJ3hPk+y4BOBk+dwXvTWEI5GFh5g1Es/VR3yKwpoQ7vkrak9IgyRMppOW9mYPLOOu sclhleKEx2mySXN0oCB/8DPXlunarLfZPZrH07AfHfAPTRPVD/7WZL76AM2Xess6rR AEVMYLt4Gt80UDtSMEnUYwLTcmxRJOBzu6MmfE4Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, yangerkun , Jan Kara , Sasha Levin Subject: [PATCH 4.19 52/91] quota: fix a problem about transfer quota Date: Fri, 12 Jul 2019 14:18:55 +0200 Message-Id: <20190712121624.453621208@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190712121621.422224300@linuxfoundation.org> References: <20190712121621.422224300@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit c6d9c35d16f1bafd3fec64b865e569e48cbcb514 ] Run below script as root, dquot_add_space will return -EDQUOT since __dquot_transfer call dquot_add_space with flags=0, and dquot_add_space think it's a preallocation. Fix it by set flags as DQUOT_SPACE_WARN. mkfs.ext4 -O quota,project /dev/vdb mount -o prjquota /dev/vdb /mnt setquota -P 23 1 1 0 0 /dev/vdb dd if=/dev/zero of=/mnt/test-file bs=4K count=1 chattr -p 23 test-file Fixes: 7b9ca4c61bc2 ("quota: Reduce contention on dq_data_lock") Signed-off-by: yangerkun Signed-off-by: Jan Kara Signed-off-by: Sasha Levin --- fs/quota/dquot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index fc20e06c56ba..dd1783ea7003 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -1993,8 +1993,8 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to) &warn_to[cnt]); if (ret) goto over_quota; - ret = dquot_add_space(transfer_to[cnt], cur_space, rsv_space, 0, - &warn_to[cnt]); + ret = dquot_add_space(transfer_to[cnt], cur_space, rsv_space, + DQUOT_SPACE_WARN, &warn_to[cnt]); if (ret) { spin_lock(&transfer_to[cnt]->dq_dqb_lock); dquot_decr_inodes(transfer_to[cnt], inode_usage); -- 2.20.1