From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6CF7FC63697 for ; Thu, 19 Nov 2020 13:59:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 26BEA246E0 for ; Thu, 19 Nov 2020 13:59:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727392AbgKSN7G (ORCPT ); Thu, 19 Nov 2020 08:59:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:43142 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726580AbgKSN7F (ORCPT ); Thu, 19 Nov 2020 08:59:05 -0500 Received: from gandalf.local.home (cpe-66-24-58-225.stny.res.rr.com [66.24.58.225]) (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 5A39B246D3; Thu, 19 Nov 2020 13:59:04 +0000 (UTC) Date: Thu, 19 Nov 2020 08:59:02 -0500 From: Steven Rostedt To: Masami Hiramatsu Cc: Linus Torvalds , Chen Yu , Chen Yu , LKML , Ingo Molnar , Jonathan Corbet Subject: Re: [PATCH v4 2/4] tools/bootconfig: Fix to check the write failure correctly Message-ID: <20201119085902.05df502b@gandalf.local.home> In-Reply-To: <20201119104109.8ab69359ce81d74c7d2d9c3f@kernel.org> References: <160571371674.277955.11736890010190945946.stgit@devnote2> <160571373504.277955.1260524414275036851.stgit@devnote2> <20201118110437.36e84496@gandalf.local.home> <20201119104109.8ab69359ce81d74c7d2d9c3f@kernel.org> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 19 Nov 2020 10:41:09 +0900 Masami Hiramatsu wrote: > > If the first write fails (doesn't modify the initrd), and then this fails, > > you will show a message of: "may be corrupted. Recommend to rebuild", when > > that would not be the case. Should a test of the size be done again, to see > > if it is already the same? > > Please see the above 2 write error check. You can find > > if (ret < 0) > goto out; > > only in the first check. (I know, it might a bit misleadable) > So, the first write is failed with error message, it doesn't call rollback. Ah right, I missed check within the error check. I was only looking at the first error and the goto at the end. -- Steve