Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2926545rwd; Fri, 16 Jun 2023 09:54:32 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7B3kGWbS3p5lxx/QqITp0zioevD6ALgP+cFhIZwiH1pI488qhQJXeQlbuZ3nGStJLuIHpJ X-Received: by 2002:a17:90b:a4f:b0:258:ddc3:3efb with SMTP id gw15-20020a17090b0a4f00b00258ddc33efbmr2221789pjb.10.1686934472334; Fri, 16 Jun 2023 09:54:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686934472; cv=none; d=google.com; s=arc-20160816; b=pCqUvhFwE/cfWdM5tPBwXensTWG4gE0Y10G+AGsKC1bSGDAIXxZD3oTVsMc+5Ylv9E mkycwizlKtWRFB9hUQLui2nTqdyvc6QXjihbaSfUnsyveooi2eFHG1RAoXK3GQVTL/AY cwMDnoVlCUyE9ov+ZmgF81TDu2enlFvzZGBQztDS/J3qbQhwy/jgG7WUCCy3Nc0rG7FO 5FmouHb+mN9015mmdXw7s7Ck4myrQw5CrudvYcBpu52NnWFB4I6LkpDJRb4J04uus58O kK+uSnr40KCstrOrxOf/UDngDHm3liUjxVywNglWTt2+vvwBnGPye5RA+yMtZHNqjmqe Z6Pg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-signature; bh=sPPoq7BWNEYmKUdVuNJC643nwmffEPPxpbN4JBDnHWU=; b=JwWk5YqcJcbz27xMbETeDBlDrqlJyN5JYo7hgXWsvmPcz/zKYS//maWb6LX70QsGdo zUTzlYlsFMS/GlOGaNhKa7gv5tO21fbTqlH52nG23YUqXoOXtJX1J48K9HUpsGBUbLAK a1tJbhkXzZZe9WCyaJMtEouZ9HCllgI/qdFN8wg2nnE0i0XXGm1PjSirtaXse0byCrHO 79/DsIVihMHL6bZUCr4+mMQLAZhOzt+Y/dcCv4T3NKV2X5pMv7OPGmgPkTCfhEA4H3E5 adjyyRNaMmXPwa68Zl/AP3Qi4BQkVLqT14AQRhUWcuEfudOcCXo8YBIXfucRRXNdd1q+ huCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=gy1exNMI; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=3jMvLEHl; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u15-20020a17090a3fcf00b00256023fabd3si1956341pjm.151.2023.06.16.09.54.16; Fri, 16 Jun 2023 09:54:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=gy1exNMI; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=3jMvLEHl; spf=pass (google.com: domain of linux-ext4-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-ext4-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345709AbjFPQvw (ORCPT + 99 others); Fri, 16 Jun 2023 12:51:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345809AbjFPQvR (ORCPT ); Fri, 16 Jun 2023 12:51:17 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 644453AA9 for ; Fri, 16 Jun 2023 09:51:11 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 11ECB21C2C; Fri, 16 Jun 2023 16:51:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1686934270; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sPPoq7BWNEYmKUdVuNJC643nwmffEPPxpbN4JBDnHWU=; b=gy1exNMIvQmO5nSt7l/UcGrTr99e0pnSEvXLI9FiShW55UVe82QnQ7E0jk5UzBggCB4a61 3p7m0ZDhMlOmi3HWk1kgepa4cvWhEH6OJli1/L6Q8KIec76coVhavyHc0yB0nbW1pWQ+Nm WX0v8jXgTLNfc7cdqG15EH85yoyiKpk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1686934270; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sPPoq7BWNEYmKUdVuNJC643nwmffEPPxpbN4JBDnHWU=; b=3jMvLEHl/4Y24KI7cLIW1I/ZVlyJ1EQsAQ8Bf/nzSLA4rlUG/mCxtHo7tFJ4PPvy57orNm 9fVFQWhnQXb8R2Dg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 0188D1330B; Fri, 16 Jun 2023 16:51:10 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id xoNZAP6SjGQkIwAAMHmgww (envelope-from ); Fri, 16 Jun 2023 16:51:10 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id 715D2A0626; Fri, 16 Jun 2023 18:51:09 +0200 (CEST) From: Jan Kara To: Ted Tso Cc: , Jan Kara Subject: [PATCH 01/11] ext4: Remove pointless sb_rdonly() checks from freezing code Date: Fri, 16 Jun 2023 18:50:47 +0200 Message-Id: <20230616165109.21695-1-jack@suse.cz> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20230616164553.1090-1-jack@suse.cz> References: <20230616164553.1090-1-jack@suse.cz> MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1143; i=jack@suse.cz; h=from:subject; bh=wgEILQQw3TNf73J+iVDhoFrUsnE/Y4j3BObZjZX/AXg=; b=owEBbQGS/pANAwAIAZydqgc/ZEDZAcsmYgBkjJLn+S8svWP6ZWVVlkZsQ/tD3MWzFot5HmL8YTZn tJYSkLCJATMEAAEIAB0WIQSrWdEr1p4yirVVKBycnaoHP2RA2QUCZIyS5wAKCRCcnaoHP2RA2QDDCA DPKuWaizap1l9yaqlg2j/VgXK3dh3Ko2z41x7U5e7vY/RvkWGT9jc9PpgjiydR9c5O1OMiOFixOhjA UZSewNWTQ6O9xBaashr3p0ozBgPXW+xPnh5aiyOf9joPu7mdVwra45000l5DuqpGWtatdVIi18/FPp ne1jY3kZ9QVrUCN/niQFsmYkoYbdlvTF/aY+GEskbn5UjZfKyz/U4hRKl8QMfyOi/uv85ZfupFvoPY hQK6rX01ksmy57MlOkNQx6iLTEFKKVQRHc067focP0N9X3CXQ9UXHCmm4zCQLLa3Kp30+20n0jzuGb rEZ5vNa85naE80kUl/0jv2MubZsIgP X-Developer-Key: i=jack@suse.cz; a=openpgp; fpr=93C6099A142276A28BBE35D815BC833443038D8C Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org ext4_freeze() and ext4_unfreeze() checks for sb_rdonly(). However this check is pointless as VFS already checks for read-only filesystem before calling filesystem specific methods. Remove the pointless checks. Signed-off-by: Jan Kara --- fs/ext4/super.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/fs/ext4/super.c b/fs/ext4/super.c index 05fcecc36244..f24a7919a328 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -6310,12 +6310,7 @@ static int ext4_sync_fs(struct super_block *sb, int wait) static int ext4_freeze(struct super_block *sb) { int error = 0; - journal_t *journal; - - if (sb_rdonly(sb)) - return 0; - - journal = EXT4_SB(sb)->s_journal; + journal_t *journal = EXT4_SB(sb)->s_journal; if (journal) { /* Now we set up the journal barrier. */ @@ -6349,7 +6344,7 @@ static int ext4_freeze(struct super_block *sb) */ static int ext4_unfreeze(struct super_block *sb) { - if (sb_rdonly(sb) || ext4_forced_shutdown(EXT4_SB(sb))) + if (ext4_forced_shutdown(EXT4_SB(sb))) return 0; if (EXT4_SB(sb)->s_journal) { -- 2.35.3