From: "Darrick J. Wong" <darrick.wong@oracle.com>
To: Eric Sandeen <sandeen@sandeen.net>
Cc: linux-xfs@vger.kernel.org
Subject: Re: [PATCH 01/13] libfrog: fix workqueue error communication problems
Date: Mon, 30 Sep 2019 12:29:00 -0700 [thread overview]
Message-ID: <20190930192900.GB66746@magnolia> (raw)
In-Reply-To: <ffc61c3e-af9e-6203-c062-e00fbee0b141@sandeen.net>
On Mon, Sep 30, 2019 at 02:23:40PM -0500, Eric Sandeen wrote:
> On 9/25/19 4:33 PM, Darrick J. Wong wrote:
> > From: Darrick J. Wong <darrick.wong@oracle.com>
> >
> > Convert all the workqueue functions to return positive error codes so
> > that we can move away from the libc-style indirect errno handling and
> > towards passing error codes directly back to callers.
>
> This all looks fine, but it doesn't really do what the commit log says,
> right?
Urrrk... yes. Clearly I stamped out the changelogs with a machine. :/
I /think/ most of the patches in that series actually have a return
conversion and a callsite conversion, but this one clearly is just...
"Convert workqueue functions to return errno errors from the C library,
then convert the callers to use str_liberror to report the runtime
error."
> The one spot where error return is changed, it was already
> positive; the rest is swapping str_liberror for str_info which is
> just cosmetic, right?
<shrug> Mostly cosmetic. Before you'd get:
INFO: Could not create workqueue
Now you get:
ERROR: creating icount workqueue: Not enough frobs.
(and it actually records it as a runtime error :P)
--D
> -Eric
>
> > Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> > ---
> > libfrog/workqueue.c | 4 ++--
> > scrub/fscounters.c | 5 ++---
> > scrub/inodes.c | 5 ++---
> > scrub/phase2.c | 8 +++-----
> > scrub/phase4.c | 6 +++---
> > scrub/read_verify.c | 3 +--
> > scrub/spacemap.c | 11 ++++-------
> > scrub/vfs.c | 3 +--
> > 8 files changed, 18 insertions(+), 27 deletions(-)
> >
> >
> > diff --git a/libfrog/workqueue.c b/libfrog/workqueue.c
> > index 73114773..a806da3e 100644
> > --- a/libfrog/workqueue.c
> > +++ b/libfrog/workqueue.c
> > @@ -106,8 +106,8 @@ workqueue_add(
> > }
> >
> > wi = malloc(sizeof(struct workqueue_item));
> > - if (wi == NULL)
> > - return ENOMEM;
> > + if (!wi)
> > + return errno;
> >
> > wi->function = func;
> > wi->index = index;
> > diff --git a/scrub/fscounters.c b/scrub/fscounters.c
> > index ad467e0c..669c5ab0 100644
> > --- a/scrub/fscounters.c
> > +++ b/scrub/fscounters.c
> > @@ -115,15 +115,14 @@ xfs_count_all_inodes(
> > scrub_nproc_workqueue(ctx));
> > if (ret) {
> > moveon = false;
> > - str_info(ctx, ctx->mntpoint, _("Could not create workqueue."));
> > + str_liberror(ctx, ret, _("creating icount workqueue"));
> > goto out_free;
> > }
> > for (agno = 0; agno < ctx->mnt.fsgeom.agcount; agno++) {
> > ret = workqueue_add(&wq, xfs_count_ag_inodes, agno, ci);
> > if (ret) {
> > moveon = false;
> > - str_info(ctx, ctx->mntpoint,
> > -_("Could not queue AG %u icount work."), agno);
> > + str_liberror(ctx, ret, _("queueing icount work"));
> > break;
> > }
> > }
> ...
>
>
next prev parent reply other threads:[~2019-09-30 22:37 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-25 21:33 [PATCH 00/13] libfrog/xfs_scrub: fix error handling Darrick J. Wong
2019-09-25 21:33 ` [PATCH 01/13] libfrog: fix workqueue error communication problems Darrick J. Wong
2019-09-30 19:23 ` Eric Sandeen
2019-09-30 19:29 ` Darrick J. Wong [this message]
2019-09-30 19:35 ` Eric Sandeen
2019-09-30 20:32 ` Eric Sandeen
2019-09-25 21:33 ` [PATCH 02/13] libfrog: fix missing error checking in workqueue code Darrick J. Wong
2019-09-30 20:37 ` Eric Sandeen
2019-09-25 21:33 ` [PATCH 03/13] libfrog: split workqueue destroy functions Darrick J. Wong
2019-09-30 22:33 ` Eric Sandeen
2019-09-25 21:33 ` [PATCH 04/13] xfs_scrub: redistribute read verify pool flush and destroy responsibilities Darrick J. Wong
2019-10-07 20:04 ` Eric Sandeen
2019-09-25 21:33 ` [PATCH 05/13] libfrog: fix per-thread variable error communication problems Darrick J. Wong
2019-10-07 20:37 ` Eric Sandeen
2019-09-25 21:33 ` [PATCH 06/13] libfrog: add missing per-thread variable error handling Darrick J. Wong
2019-10-09 21:16 ` Eric Sandeen
2019-10-09 21:40 ` Eric Sandeen
2019-09-25 21:34 ` [PATCH 07/13] libfrog: fix bitmap error communication problems Darrick J. Wong
2019-10-09 21:27 ` Eric Sandeen
2019-09-25 21:34 ` [PATCH 08/13] libfrog: fix missing error checking in bitmap code Darrick J. Wong
2019-10-09 21:30 ` Eric Sandeen
2019-09-25 21:34 ` [PATCH 09/13] xfs_scrub: fix per-thread counter error communication problems Darrick J. Wong
2019-10-09 21:46 ` Eric Sandeen
2019-10-10 3:05 ` Darrick J. Wong
2019-10-15 16:57 ` Eric Sandeen
2019-09-25 21:34 ` [PATCH 10/13] xfs_scrub: report all progressbar creation failures Darrick J. Wong
2019-10-09 21:47 ` Eric Sandeen
2019-09-25 21:34 ` [PATCH 11/13] xfs_scrub: check progress bar timedwait failures Darrick J. Wong
2019-10-09 21:49 ` Eric Sandeen
2019-09-25 21:34 ` [PATCH 12/13] xfs_scrub: move all the queue_subdir error reporting to callers Darrick J. Wong
2019-10-09 21:54 ` Eric Sandeen
2019-09-25 21:34 ` [PATCH 13/13] xfs_scrub: fix error handling problems in vfs.c Darrick J. Wong
2019-10-09 21:57 ` Eric Sandeen
-- strict thread matches above, loose matches on Subject: below --
2019-09-06 3:36 [PATCH 00/13] libfrog/xfs_scrub: fix error handling Darrick J. Wong
2019-09-06 3:36 ` [PATCH 01/13] libfrog: fix workqueue error communication problems Darrick J. Wong
2019-08-26 21:28 [PATCH 00/13] libfrog/xfs_scrub: fix error handling Darrick J. Wong
2019-08-26 21:28 ` [PATCH 01/13] libfrog: fix workqueue error communication problems Darrick J. Wong
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=20190930192900.GB66746@magnolia \
--to=darrick.wong@oracle.com \
--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;
as well as URLs for NNTP newsgroup(s).