xfs
[Top] [All Lists]

Re: [PATCH V2] xfsprogs: xfs_copy: use exit() to replace killall()

To: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Subject: Re: [PATCH V2] xfsprogs: xfs_copy: use exit() to replace killall()
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Tue, 6 May 2014 18:00:23 +1000
Cc: Junxiao Bi <junxiao.bi@xxxxxxxxxx>, joe.jin@xxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20140506075742.GB13191@xxxxxxxxxxxxx>
References: <1399359284-20536-1-git-send-email-junxiao.bi@xxxxxxxxxx> <20140506075742.GB13191@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Tue, May 06, 2014 at 12:57:42AM -0700, Christoph Hellwig wrote:
> On Tue, May 06, 2014 at 02:54:44PM +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. Replace killall()+abort() with exit(1) to match the old way
> > exit in error case. Also remove killall()+pthread_exit(NULL) since return 0
> > will be followed by an exit(0) to terminate the process.
> > 
> > Bug story from Chrisoph Hellwig:
> > 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
> > 
> > Signed-off-by: Junxiao Bi <junxiao.bi@xxxxxxxxxx>
> > Cc: Joe jin <joe.jin@xxxxxxxxxx>
> > Cc: Chrisoph Hellwig <hch@xxxxxxxxxxxxx>
> 
> Looks good (except that you misspelled by name :))
> 
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>

I can fix that ;)

I'll queue this up for after the 3.2.0 release.

Cheers,

Dave.

-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>