Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp418344pxb; Thu, 13 Jan 2022 09:04:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJy3cCpZqmTWbM7gbIM8RrqK09WdmSxsRSTrrPjnKQ62LExc7KHBP9eBdi3uUkq8nlVh+0df X-Received: by 2002:a05:6402:424c:: with SMTP id g12mr4991153edb.4.1642093442183; Thu, 13 Jan 2022 09:04:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1642093442; cv=none; d=google.com; s=arc-20160816; b=lzGNt4rxEOtJQMsx979uMZc1sip4IBO0GR3hGk+78M8g2Eg+Tf2NvTfkTgxvn33mvu wY3WOidBVITxiX3Hz+PTNDwVO83nUf92e71doxV7pcWFpgkuNV8X1iGRXsGdMmUatJII VzcZvTj+zh5qbP33upzzK1wAAuKGy9K14cPmUO+pyypdMH/RbzKjEqrQi+YFIdVKRQUh a7SeONwZQNxx3F97RKspDMIgJHUmzJT9nAdglrBrSWnh16jHy1JnwXvTBzn6a0bhU8kh ES2bqrR/yks1VbNMDfeFxK3KUV/v//s7yBFbWhMOX5sbcFLUJPpKzR5vPDYDcoCST/vh WIRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=jG2YBmKxjGm7yo2Ve7nOVVYEHMKVyhyJf6tIbfNxbRM=; b=X8cUYGVQGnzIutECpvH09S+s3enSOQkJTyHBsmh3WA4pmrK+mhdqysTvIg/chyVnoN wSGPIlgsuqnqhl9haqw/HdsNXPmkb0KK/IGO+5vjuS7sHqkV7iX2xdQxIHUOJUoMaYGF MQzV5lfXRlL/2+krLplRxGv/ofBZ74eSA6z9pc5lT5Edh8P0SigTPK0LQoPcJ2YUxqz+ IZKayUaZSjWlkZ+OrjtrxuBUAm2hyyNOVa91HumBLcGsgQo+BqyVEI0SkQuHDtMgrV2C Tqp99siM3YZqEthvJLL4BgEN4xybDEw9Z/iyTlNaNEEAlCOeN96Uo7UDSU9tEKzv82v6 YTQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=xaEBgzRA; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mp40si1647219ejc.965.2022.01.13.09.03.23; Thu, 13 Jan 2022 09:04:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=xaEBgzRA; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233815AbiAMK6D (ORCPT + 99 others); Thu, 13 Jan 2022 05:58:03 -0500 Received: from smtp-out2.suse.de ([195.135.220.29]:43218 "EHLO smtp-out2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233820AbiAMK6C (ORCPT ); Thu, 13 Jan 2022 05:58:02 -0500 Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 40CE71F3BC; Thu, 13 Jan 2022 10:58:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1642071481; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jG2YBmKxjGm7yo2Ve7nOVVYEHMKVyhyJf6tIbfNxbRM=; b=xaEBgzRALckvYaXQWmg0Sp787ke7YPnqaZ2GgC2sp/walSexq0QHRNs0E/6sHmlx5xKelc NJwoBZHbGMGjjvn8yqZOEkz6Pm7YPZEjkL2e9/TdOBj4pSVS0ClGKRovoBa2m4Ju5FEeJj NP9UcuF/PnucO4i6INRvlydh1kAC4tI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1642071481; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=jG2YBmKxjGm7yo2Ve7nOVVYEHMKVyhyJf6tIbfNxbRM=; b=Cgjr6zCU/nrJzGkMdXvSwhSSk8ftcCjcJRB60rbuIKLIGSNQnZ08zAVL9Migzjyi+z7MMB z2RbVJL13CZSbVAw== Received: from quack3.suse.cz (unknown [10.163.28.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 2F9F6A3B83; Thu, 13 Jan 2022 10:58:01 +0000 (UTC) Received: by quack3.suse.cz (Postfix, from userid 1000) id CCCB2A05E2; Thu, 13 Jan 2022 11:58:00 +0100 (CET) Date: Thu, 13 Jan 2022 11:58:00 +0100 From: Jan Kara To: Ritesh Harjani Cc: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Kara , Andreas Dilger , tytso@mit.edu, Eric Whitney Subject: Re: [PATCH 2/6] ext4: Remove redundant max inline_size check in ext4_da_write_inline_data_begin() Message-ID: <20220113105800.onazeyrdh3mr2bjw@quack3.lan> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Thu 13-01-22 08:56:25, Ritesh Harjani wrote: > ext4_prepare_inline_data() already checks for ext4_get_max_inline_size() > and returns -ENOSPC. So there is no need to check it twice within > ext4_da_write_inline_data_begin(). This patch removes the extra check. > > It also makes it more clean. > > No functionality change in this patch. > > Signed-off-by: Ritesh Harjani Looks good. Feel free to add: Reviewed-by: Jan Kara Honza > --- > fs/ext4/inline.c | 13 ++++--------- > 1 file changed, 4 insertions(+), 9 deletions(-) > > diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c > index 31741e8a462e..c52b0037983d 100644 > --- a/fs/ext4/inline.c > +++ b/fs/ext4/inline.c > @@ -913,7 +913,7 @@ int ext4_da_write_inline_data_begin(struct address_space *mapping, > struct page **pagep, > void **fsdata) > { > - int ret, inline_size; > + int ret; > handle_t *handle; > struct page *page; > struct ext4_iloc iloc; > @@ -930,14 +930,9 @@ int ext4_da_write_inline_data_begin(struct address_space *mapping, > goto out; > } > > - inline_size = ext4_get_max_inline_size(inode); > - > - ret = -ENOSPC; > - if (inline_size >= pos + len) { > - ret = ext4_prepare_inline_data(handle, inode, pos + len); > - if (ret && ret != -ENOSPC) > - goto out_journal; > - } > + ret = ext4_prepare_inline_data(handle, inode, pos + len); > + if (ret && ret != -ENOSPC) > + goto out_journal; > > /* > * We cannot recurse into the filesystem as the transaction > -- > 2.31.1 > -- Jan Kara SUSE Labs, CR