Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4639279ybl; Mon, 9 Dec 2019 14:24:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyQhUMdQkBZYw/TMF+djn3MXk++S6Z45+kkNXP5ia9r6Vc49sfIcybaZ8uHLuWOYngXZ+FT X-Received: by 2002:a9d:7f16:: with SMTP id j22mr22770634otq.256.1575930276493; Mon, 09 Dec 2019 14:24:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575930276; cv=none; d=google.com; s=arc-20160816; b=OHjThD03lvkYz66Z5xAGlS0H4ebvK+jkJ3FA+7o0BxAlTtOM/xrFYT4szgCP4f187J GfAN3Phh3WIEsUylnxUnmqcJb02BljqnLPOQwrUZ+Zea1xQJbKoABGVkJIOPknocKGiC tM5w8YQiYAQUVaQkKO7amsHJPIyUCCaE9XeIIA4mR9IVDzZinBV3x+jKX1+Sv16HjQ27 OnF2FF1Mv8Wolekdzk8MLa/cyhw6ZgkWQEaC/r/O2xG+XS5HGxY0CNQqtPElAE6U2+hH rKvZ/v0Yp+QvAjPhLdEAug6Yc6X/pYnEYjfAVwG2AIltCTURugtva1Y4A2q7OwqdsIFk ERjg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=M0fZM1jpsDmN56hwV25T0w9K/auMbpXtoK8qJktu21c=; b=t9b68pRpfqU31Dkecw5bIpE7w0Gb0dTsDCFv9DsZehcXdWKyKDQxK9Esj8GlYzcTXa bDMQMG7UdIMVQB1C/wi1Ud2XbPubx1rCtADRVJly1NU5Ns14n5RVS2lsiYuYWA7w869H EqD5DWnNhMS9opJ4TRS4GzmCYdQE8o1qxGGtf5iuaeHZrkny8E9gREoSk5RwHQ3O1WFF j2ZnoA2blTddm2gNutQUtyu5CbpEODlt/Za0BAkEbHO+MjMhmiP+xLs+Yk3D/X7+TE/n jUVibR+18eaqM6qPxxFATW5KMI6+lgOfYF8YPGE1mc3mPKlCYInfOG9OUeYOVR4vi0Zh R9jA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=QEnd3J1o; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q65si861345oic.78.2019.12.09.14.24.21; Mon, 09 Dec 2019 14:24:36 -0800 (PST) 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=QEnd3J1o; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726949AbfLIWXt (ORCPT + 99 others); Mon, 9 Dec 2019 17:23:49 -0500 Received: from mail.kernel.org ([198.145.29.99]:40550 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726483AbfLIWXs (ORCPT ); Mon, 9 Dec 2019 17:23:48 -0500 Received: from localhost (unknown [104.132.0.81]) (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 2071320721; Mon, 9 Dec 2019 22:23:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575930228; bh=TaaCS8RTMLVqjYqfCHXD8HZCQIXSSSjJveEkKOckY4w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QEnd3J1oeG0+9T5erKTz7uO3O/W4upU6IBhql845eAAUb9M1shFMafFgW7msGEALi x8BqBGByDYM3xHhe+beDrAFBDqRPC4WbiGdKYT/QtdK9i1nLpVh9WmAkErHZuYnOVH VJb7p6YckhqOTppjiXn/BsBoQcBSpfGpSxKxcxzM= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net Cc: Jaegeuk Kim Subject: [PATCH 3/6] f2fs: keep quota data on write_begin failure Date: Mon, 9 Dec 2019 14:23:42 -0800 Message-Id: <20191209222345.1078-3-jaegeuk@kernel.org> X-Mailer: git-send-email 2.19.0.605.g01d371f741-goog In-Reply-To: <20191209222345.1078-1-jaegeuk@kernel.org> References: <20191209222345.1078-1-jaegeuk@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patch avoids some unnecessary locks for quota files when write_begin fails. Signed-off-by: Jaegeuk Kim --- fs/f2fs/data.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index fc40a72f7827..3b2945121557 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -2600,14 +2600,16 @@ static void f2fs_write_failed(struct address_space *mapping, loff_t to) struct inode *inode = mapping->host; loff_t i_size = i_size_read(inode); + if (IS_NOQUOTA(inode)) + return; + /* In the fs-verity case, f2fs_end_enable_verity() does the truncate */ if (to > i_size && !f2fs_verity_in_progress(inode)) { down_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]); down_write(&F2FS_I(inode)->i_mmap_sem); truncate_pagecache(inode, i_size); - if (!IS_NOQUOTA(inode)) - f2fs_truncate_blocks(inode, i_size, true); + f2fs_truncate_blocks(inode, i_size, true); up_write(&F2FS_I(inode)->i_mmap_sem); up_write(&F2FS_I(inode)->i_gc_rwsem[WRITE]); -- 2.19.0.605.g01d371f741-goog