From: Dave Chinner <david@fromorbit.com>
To: "Darrick J. Wong" <djwong@kernel.org>
Cc: linux-xfs@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH 1/3] mm: Add kvrealloc()
Date: Thu, 1 Jul 2021 07:49:03 +1000 [thread overview]
Message-ID: <20210630214903.GF664593@dread.disaster.area> (raw)
In-Reply-To: <20210630160843.GM13784@locust>
On Wed, Jun 30, 2021 at 09:08:43AM -0700, Darrick J. Wong wrote:
> On Wed, Jun 30, 2021 at 04:14:29PM +1000, Dave Chinner wrote:
> > From: Dave Chinner <dchinner@redhat.com>
> > diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> > index 1721fce2ec94..fee4fbadea0a 100644
> > --- a/fs/xfs/xfs_log_recover.c
> > +++ b/fs/xfs/xfs_log_recover.c
> > @@ -2062,7 +2062,7 @@ xlog_recover_add_to_cont_trans(
> > old_ptr = item->ri_buf[item->ri_cnt-1].i_addr;
> > old_len = item->ri_buf[item->ri_cnt-1].i_len;
> >
> > - ptr = krealloc(old_ptr, len + old_len, GFP_KERNEL | __GFP_NOFAIL);
> > + ptr = kvrealloc(old_ptr, old_len, len + old_len, GFP_KERNEL);
>
> kvrealloc can return null, so this needs to check for that and -ENOMEM,
> right? It'll suck that log recovery fails, but such is life.
Ok, looking through the code it seems that returning -ENOMEM here
is a non-destructive (i.e. retry-able) failure. It will simply stop
processing the log at the point this occurs and abort all pending
objects that haven't been processed. The error message is less than
stellar ("log mount/recovery failed: error %d") but at least no
other damage will be done. I'll update it.
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2021-06-30 21:49 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-30 6:14 [PATCH 0/3 v2] mm, xfs: memory allocation improvements Dave Chinner
2021-06-30 6:14 ` [PATCH 1/3] mm: Add kvrealloc() Dave Chinner
2021-06-30 10:04 ` Mel Gorman
2021-06-30 12:05 ` Michal Hocko
2021-06-30 16:08 ` Darrick J. Wong
2021-06-30 21:49 ` Dave Chinner [this message]
2021-06-30 6:14 ` [PATCH 2/3] xfs: remove kmem_alloc_io() Dave Chinner
2021-06-30 16:09 ` Darrick J. Wong
2021-06-30 6:14 ` [PATCH 3/3] xfs: replace kmem_alloc_large() with kvmalloc() Dave Chinner
-- strict thread matches above, loose matches on Subject: below --
2021-07-14 2:34 [PATCH 0/3 v3] xfs, mm: memory allocation improvements Dave Chinner
2021-07-14 2:34 ` [PATCH 1/3] mm: Add kvrealloc() Dave Chinner
2021-07-14 11:05 ` Mel Gorman
2021-07-14 21:15 ` Darrick J. Wong
2021-06-25 2:30 [PATCH 0/3] mm, xfs: memory allocation improvements Dave Chinner
2021-06-25 2:30 ` [PATCH 1/3] mm: Add kvrealloc() Dave Chinner
2021-06-25 2:40 ` Miaohe Lin
2021-06-25 5:05 ` Dave Chinner
2021-06-25 3:54 ` Matthew Wilcox
2021-06-25 5:02 ` Dave Chinner
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=20210630214903.GF664593@dread.disaster.area \
--to=david@fromorbit.com \
--cc=djwong@kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
/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).