Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp36953rwb; Wed, 17 Aug 2022 22:12:38 -0700 (PDT) X-Google-Smtp-Source: AA6agR4F5nSFDdLSmQYQzC/FbRTJtBudygIG1i/gZcChXoCFHtziMrAwGiJgj3ajWN5I5XQR+dJi X-Received: by 2002:a17:907:2816:b0:731:5103:baf2 with SMTP id eb22-20020a170907281600b007315103baf2mr789225ejc.429.1660799557826; Wed, 17 Aug 2022 22:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660799557; cv=none; d=google.com; s=arc-20160816; b=UihIokI7IyUnvncX1SzGOyUnXjC6sbwlQ3EMLJn3gAqWsN4sZI7zVG7t3f6yn+C/pj InCHOQJIay9QFqvmeIHfzut/zEsaUm4+Wyl49y4KhXNyafiv6Pty7BaJ88m7UHBYV4z6 Ll1AwrtIhume+trUznMWx7srxNezrRs3iBKAPWXqbb1g3ZiVujoBGSCLet16vK8x2Lkb lGBD2k2HE2kvDTXcTY+UBpYln8qzAMkdJUte2uDGZwYlh13yq4/0TqjtmG9fdf5BuV5E mSIwr/h4TXiwM1pk26HJoVpLJ6LDrbCGsDt64ZWHiNThGxGRgpq+/fKl7bK6RJbzI0aP EdPg== 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; bh=CIXPojNt+yIDbPYg2qBN1uuNsthwKBFWVWuxVjGTqgo=; b=iUs+CIP/Jwbi2qbdQQHGeSXOv3NmOcyyXlQiHQRS/n9bkI/5TAC/3wki0BJwlMzZNk aA1wVtRv6pOOTHvmPsSfsWMTvCPxAVQivVdVZW3zrk2dnKJbaIn/x8AzwWBhzVkP+a+E 9WMX1oPsaCeiu8fl/uMWGhnOeOeMq0zgbdbQJS1n8asTJEd3vVi1KEPeRGJtjS+wxe+z 0KKXn9Tn6iLJKhCzEM2iXq6L+rUJu5slvY/ehGeTxQiJzTWWQhKWXKPp43mzd9EIqhN3 p68j4ZFrtsucq0TF/61osRxHMUM8KsZLX4oBzxq98veb+Ap6IuJPsi8eLs66P4Ue2Ok3 Qphw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TRzMhtMr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ww7-20020a170907084700b0073136f89f8fsi404523ejb.148.2022.08.17.22.12.13; Wed, 17 Aug 2022 22:12:37 -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=@gmail.com header.s=20210112 header.b=TRzMhtMr; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243035AbiHRFFK (ORCPT + 99 others); Thu, 18 Aug 2022 01:05:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242769AbiHRFFG (ORCPT ); Thu, 18 Aug 2022 01:05:06 -0400 Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79D869F1B6; Wed, 17 Aug 2022 22:05:04 -0700 (PDT) Received: by mail-pl1-x62b.google.com with SMTP id jm11so579839plb.13; Wed, 17 Aug 2022 22:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=CIXPojNt+yIDbPYg2qBN1uuNsthwKBFWVWuxVjGTqgo=; b=TRzMhtMr+7LC87xERlKGV5G6CxzQx5xbGT9HbWz+Gnh28ZyzkvcbsRPRjazJEIfiPk OchvFk0j2y8dQA88uW4rT4kDzx19T1pUsNZTk0MmswMmjf+7h4D+dWq1lTTjhjcPJ5wB nEzMroSn59Bcyv5lVTp17tbHffMFvptE4IG9vpy2Vc5NH43IpTuAGu8UoS4ZY5OOAs4C 52QKxhNOeeYFJ+RfiJa44rn6QxL3GzYy7YfHwhkr/vobUhRYio1ywP8+xrhQ4H1WEIlo Z8Sv4XRhLzksyrD29r08JtoRZkrFEjnasi7Dp4jqFmClN8/q9FN6OfT0vEs35q+EyXVq Tb7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=CIXPojNt+yIDbPYg2qBN1uuNsthwKBFWVWuxVjGTqgo=; b=tbOF1zF/n/MrSHnrkGKyHdBvKPF1ki9O6k80cpqASgYqbiiB101RN7OX4U4kuOeq2w hu1xH0tjHCScL2QbVEBa7W3EHipaLJZNMesnDRFjq7mHiykuCN+qErp0d7fZMTm7M1bx yQ8KlW3c0fFsViNR2by4opeYxZoQnZqu9SWsT/fYNeBy1itld4WkBzN7Lat/WJ3sFxR6 QAT1eVlCwJgf5k5bfnDc/ZMjPKkHm894gIvYaZkuYtqqRN7tIqKJPINTdVr+BMIJ0CZ1 ZpEWaOtxBpNAuS4uUXT6uDINau4PwHn0D2obHr9mlMtpUKhrntJEJ9kYFt7ZZnSLaly/ 9oaQ== X-Gm-Message-State: ACgBeo1chpgMQF16Zcmt+VbvOXmWIGy0avf+DEwZBHJNsVS0DfLetyIW m7sSLFtZFTBP+1Sf9zo2ts+wGk/5CNw= X-Received: by 2002:a17:902:dac9:b0:172:af95:2db4 with SMTP id q9-20020a170902dac900b00172af952db4mr1414037plx.70.1660799103779; Wed, 17 Aug 2022 22:05:03 -0700 (PDT) Received: from localhost ([2406:7400:63:e947:599c:6cd1:507f:801e]) by smtp.gmail.com with ESMTPSA id j8-20020a170902da8800b0016edff78844sm330530plx.277.2022.08.17.22.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Aug 2022 22:05:03 -0700 (PDT) From: "Ritesh Harjani (IBM)" To: linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Jan Kara , Alexander Viro , Christoph Hellwig , linux-ntfs-dev@lists.sourceforge.net, "Ritesh Harjani (IBM)" , Jan Kara Subject: [PATCHv3 1/4] jbd2: Drop useless return value of submit_bh Date: Thu, 18 Aug 2022 10:34:37 +0530 Message-Id: X-Mailer: git-send-email 2.35.3 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 submit_bh always returns 0. This patch cleans up 2 of it's caller in jbd2 to drop submit_bh's useless return value. Once all submit_bh callers are cleaned up, we can make it's return type as void. Reviewed-by: Christoph Hellwig Reviewed-by: Jan Kara Signed-off-by: Ritesh Harjani (IBM) --- fs/jbd2/commit.c | 10 ++++------ fs/jbd2/journal.c | 9 ++++----- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c index b2b2bc9b88d9..6b51d2dc56e2 100644 --- a/fs/jbd2/commit.c +++ b/fs/jbd2/commit.c @@ -122,8 +122,8 @@ static int journal_submit_commit_record(journal_t *journal, { struct commit_header *tmp; struct buffer_head *bh; - int ret; struct timespec64 now; + blk_opf_t write_flags = REQ_OP_WRITE | REQ_SYNC; *cbh = NULL; @@ -155,13 +155,11 @@ static int journal_submit_commit_record(journal_t *journal, if (journal->j_flags & JBD2_BARRIER && !jbd2_has_feature_async_commit(journal)) - ret = submit_bh(REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH | - REQ_FUA, bh); - else - ret = submit_bh(REQ_OP_WRITE | REQ_SYNC, bh); + write_flags |= REQ_PREFLUSH | REQ_FUA; + submit_bh(write_flags, bh); *cbh = bh; - return ret; + return 0; } /* diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c index 6350d3857c89..f669ae1ff7a2 100644 --- a/fs/jbd2/journal.c +++ b/fs/jbd2/journal.c @@ -1606,7 +1606,7 @@ static int jbd2_write_superblock(journal_t *journal, blk_opf_t write_flags) { struct buffer_head *bh = journal->j_sb_buffer; journal_superblock_t *sb = journal->j_superblock; - int ret; + int ret = 0; /* Buffer got discarded which means block device got invalidated */ if (!buffer_mapped(bh)) { @@ -1636,7 +1636,7 @@ static int jbd2_write_superblock(journal_t *journal, blk_opf_t write_flags) sb->s_checksum = jbd2_superblock_csum(journal, sb); get_bh(bh); bh->b_end_io = end_buffer_write_sync; - ret = submit_bh(REQ_OP_WRITE | write_flags, bh); + submit_bh(REQ_OP_WRITE | write_flags, bh); wait_on_buffer(bh); if (buffer_write_io_error(bh)) { clear_buffer_write_io_error(bh); @@ -1644,9 +1644,8 @@ static int jbd2_write_superblock(journal_t *journal, blk_opf_t write_flags) ret = -EIO; } if (ret) { - printk(KERN_ERR "JBD2: Error %d detected when updating " - "journal superblock for %s.\n", ret, - journal->j_devname); + printk(KERN_ERR "JBD2: I/O error when updating journal superblock for %s.\n", + journal->j_devname); if (!is_journal_aborted(journal)) jbd2_journal_abort(journal, ret); } -- 2.35.3