From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: sandeen@sandeen.net, linux-xfs@vger.kernel.org
Subject: Re: [PATCH 05/14] libxfs: make libxfs_buf_read_map return an error code
Date: Tue, 25 Feb 2020 10:59:03 -0800 [thread overview]
Message-ID: <20200225185903.GO6740@magnolia> (raw)
In-Reply-To: <20200225175524.GA4129@infradead.org>
On Tue, Feb 25, 2020 at 09:55:24AM -0800, Christoph Hellwig wrote:
> On Mon, Feb 24, 2020 at 04:14:40PM -0800, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > Make libxfs_buf_read_map() and libxfs_readbuf() return an error code
> > instead of making callers guess what happened based on whether or not
> > they got a buffer back.
> >
> > Add a new SALVAGE flag so that certain utilities (xfs_db and xfs_repair)
> > can attempt salvage operations even if the verifiers failed, which was
> > the behavior before this change.
> >
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> > db/io.c | 4 +--
> > libxfs/libxfs_io.h | 25 ++++++++++++------
> > libxfs/rdwr.c | 71 +++++++++++++++++++++++++++++++++++++++++-----------
> > libxfs/trans.c | 24 ++++--------------
> > repair/da_util.c | 3 +-
> > 5 files changed, 82 insertions(+), 45 deletions(-)
> >
> >
> > diff --git a/db/io.c b/db/io.c
> > index b81e9969..5c9d72bb 100644
> > --- a/db/io.c
> > +++ b/db/io.c
> > @@ -542,8 +542,8 @@ set_cur(
> > if (!iocur_top->bbmap)
> > return;
> > memcpy(iocur_top->bbmap, bbmap, sizeof(struct bbmap));
> > - bp = libxfs_buf_read_map(mp->m_ddev_targp, bbmap->b,
> > - bbmap->nmaps, 0, ops);
> > + libxfs_buf_read_map(mp->m_ddev_targp, bbmap->b, bbmap->nmaps,
> > + LIBXFS_READBUF_SALVAGE, &bp, ops);
> > } else {
> > bp = libxfs_buf_read(mp->m_ddev_targp, blknum, len, 0, ops);
> > iocur_top->bbmap = NULL;
>
> I think instead of ignorining the error and checkig b_error further down
> that should be moved to work based on the return value.
Yeah, I'll add a cleanup patch for that on the end, after we convert
libxfs_buf_read. Thanks for reviewing!
--D
> Otherwise looks good:
>
> Reviewed-by: Christoph Hellwig <hch@lst.de>
next prev parent reply other threads:[~2020-02-25 18:59 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-25 0:14 [PATCH v2 00/14] xfsprogs: make buffer functions return error codes Darrick J. Wong
2020-02-25 0:14 ` [PATCH 01/14] libxfs: make __cache_lookup return an error code Darrick J. Wong
2020-02-25 0:14 ` [PATCH 02/14] libxfs: make libxfs_getbuf_flags " Darrick J. Wong
2020-02-25 0:14 ` [PATCH 03/14] libxfs: make libxfs_buf_get_map " Darrick J. Wong
2020-02-25 0:14 ` [PATCH 04/14] libxfs: refactor libxfs_readbuf out of existence Darrick J. Wong
2020-02-25 0:14 ` [PATCH 05/14] libxfs: make libxfs_buf_read_map return an error code Darrick J. Wong
2020-02-25 17:55 ` Christoph Hellwig
2020-02-25 18:59 ` Darrick J. Wong [this message]
2020-02-25 0:14 ` [PATCH 06/14] xfs: make xfs_buf_read_map " Darrick J. Wong
2020-02-25 0:14 ` [PATCH 07/14] xfs: make xfs_buf_get " Darrick J. Wong
2020-02-25 0:15 ` [PATCH 08/14] xfs: make xfs_buf_get_uncached " Darrick J. Wong
2020-02-25 0:15 ` [PATCH 09/14] xfs: make xfs_buf_read " Darrick J. Wong
2020-02-25 0:15 ` [PATCH 10/14] xfs: make xfs_trans_get_buf_map " Darrick J. Wong
2020-02-25 0:15 ` [PATCH 11/14] xfs: make xfs_trans_get_buf " Darrick J. Wong
2020-02-25 0:15 ` [PATCH 12/14] xfs: remove the xfs_btree_get_buf[ls] functions Darrick J. Wong
2020-02-25 0:15 ` [PATCH 13/14] xfs: make xfs_*read_agf return EAGAIN to ALLOC_FLAG_TRYLOCK callers Darrick J. Wong
2020-02-25 0:15 ` [PATCH 14/14] xfs: remove unnecessary null pointer checks from _read_agf callers Darrick J. Wong
-- strict thread matches above, loose matches on Subject: below --
2020-02-20 1:44 [PATCH 00/14] xfsprogs: make buffer functions return error codes Darrick J. Wong
2020-02-20 1:45 ` [PATCH 05/14] libxfs: make libxfs_buf_read_map return an error code Darrick J. Wong
2020-02-21 15:03 ` Christoph Hellwig
2020-02-21 16:15 ` Darrick J. Wong
2020-02-21 16:28 ` Christoph Hellwig
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=20200225185903.GO6740@magnolia \
--to=darrick.wong@oracle.com \
--cc=hch@infradead.org \
--cc=linux-xfs@vger.kernel.org \
--cc=sandeen@sandeen.net \
/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