linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Theodore Ts'o" <tytso@mit.edu>
To: Li Jinlin <lijinlin3@huawei.com>
Cc: adilger@whamcloud.com, linux-ext4@vger.kernel.org,
	linfeilong@huawei.com, liuzhiqiang26@huawei.com
Subject: Re: [PATCH] tune2fs: exit directly when fs freed in ext2fs_run_ext3_journal
Date: Thu, 20 Oct 2022 13:08:12 -0400	[thread overview]
Message-ID: <Y1GAfCVhruEJ+5IL@mit.edu> (raw)
In-Reply-To: <20220916074223.8885-1-lijinlin3@huawei.com>

On Fri, Sep 16, 2022 at 03:42:23PM +0800, Li Jinlin wrote:
> In ext2fs_run_ext3_journal(), fs will be free and reallocate. But
> reallocating by ext2fs_open() may fail in some cases, such as device
> being offline at the same time. In these cases, goto closefs will
> cause segfault, fix it by exiting directly.
> 
> Signed-off-by: Li Jinlin <lijinlin3@huawei.com>

Thanks, applied, although I simplified the patch a little:

@@ -3106,6 +3106,8 @@ _("Warning: The journal is dirty. You may wish to replay the journal like:\n\n"
                        com_err("tune2fs", retval,
                                "while recovering journal.\n");
                        printf(_("Please run e2fsck -fy %s.\n"), argv[1]);
+                       if (!fs)
+                               exit(1);
                        rc = 1;
                        goto closefs;
                }

					- Ted

      parent reply	other threads:[~2022-10-20 17:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-16  7:42 [PATCH] tune2fs: exit directly when fs freed in ext2fs_run_ext3_journal Li Jinlin
2022-09-26  9:46 ` Li Jinlin
2022-10-20 17:08 ` Theodore Ts'o [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y1GAfCVhruEJ+5IL@mit.edu \
    --to=tytso@mit.edu \
    --cc=adilger@whamcloud.com \
    --cc=lijinlin3@huawei.com \
    --cc=linfeilong@huawei.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=liuzhiqiang26@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).