On 04/26/2016 12:23 AM, David Sterba wrote:
On Thu, Mar 24, 2016 at 06:48:13PM +0800, Anand Jain wrote:
Sysfs create context should come in the last, so that we
don't have to undo sysfs operation for the reason that any
other operation has failed.

Moving the sysfs call will make a visible change: in the old code, the
sysfs node exists during the whole replace process, while in the new
code it appears only after it finishes.

While this is not necessarily a
problem, I'd like to check that his is an intended change, as it's not
mentioned in the changelog.

 Ah. I missed this point.

Besides, the sysfs node seems to be added unconditionally, so if the
scrub is running in parallel (checked a few lines above the new code),
we'll happily add the target device although no replace happened.

Replace may take a long time, We definitely need devid 0 shown at
sysfs. Apparently we don't have the undo-sysfs part in the original
code, which this patch tried to mitigate, but it needs a deeper fix.
I have to pull this patch out and leave the original bug as is for now.

Further we need to handle fail return of btrfs_dev_replace_finishing()
which seeks sysfs and rest of the stuff un-done as well.

Thanks, Anand
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to