From: Christoph Hellwig <hch@infradead.org>
To: Junxiao Bi <junxiao.bi@oracle.com>
Cc: joe.jin@oracle.com, xfs@oss.sgi.com
Subject: Re: [PATCH] xfsprogs: xfs_copy: use exit() to replace killall()
Date: Sun, 4 May 2014 03:34:43 -0700 [thread overview]
Message-ID: <20140504103443.GA25154@infradead.org> (raw)
In-Reply-To: <1399189455-29890-1-git-send-email-junxiao.bi@oracle.com>
On Sun, May 04, 2014 at 03:44:15PM +0800, Junxiao Bi wrote:
> Sending a SIGKILL signal to child thread will terminate the whole process,
> xfs_copy will return an error value 137. This cause confuse for script to
> know whether the copy successes.
>
> Calling exit() in main thread can terminate the whole process and return the
> right value.
Looks generally good to me, but the changelog should have some more
details:
> if (buf->length > buf->size) {
> do_warn(_("assert error: buf->length = %d, buf->size = %d\n"),
> buf->length, buf->size);
> - killall();
> - abort();
> + exit(1);
You're replacing the killall with an exit here and removing the abort()
call. I can see arguments for keeping either the abort or exit, but please
document why you did in the patch description. If the exit was
intentional should we return a different value for an assertation
failure?
> - killall();
> - pthread_exit(NULL);
> - /*NOTREACHED*/
> - return 0;
> +
> + exit(0);
You're also replacing the return 0 from main with an exit which
seem superflous.
Btw, I think the reason for this cruft is that xfs_copy was originally
written using the IRIX sproc interface, and the port to pthreads didn't
remove this gem:
http://marc.info/?l=linux-xfs&m=99535721110020&w=2
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next prev parent reply other threads:[~2014-05-04 10:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-05-04 7:44 [PATCH] xfsprogs: xfs_copy: use exit() to replace killall() Junxiao Bi
2014-05-04 10:34 ` Christoph Hellwig [this message]
2014-05-05 6:13 ` Junxiao Bi
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=20140504103443.GA25154@infradead.org \
--to=hch@infradead.org \
--cc=joe.jin@oracle.com \
--cc=junxiao.bi@oracle.com \
--cc=xfs@oss.sgi.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.