On 11/30/2018 09:05 AM, Anand Jain wrote:


On 11/29/2018 10:31 PM, David Sterba wrote:
On Wed, Nov 28, 2018 at 04:47:27PM +0800, Anand Jain wrote:
2. scrub_workers_refcnt must eventually be converted to refcount_t type

   ok. Added in v2 patch set.

No such thing is in v2 and this would actually get rid of the need to
hold scrub_lock in scrub_workers_put.

 Well we still need scrub_lock, because we spun scrub thread per device,
 and these threads can race as well. So the first scrub thread should
 make sure the scrub workers are allocated and keep the other threads
 waiting.
 As of now btrfs-progs serializes the scrub per device. But btrfs-progs
 is just one of the tool and there can be some other similar tool. We
 need hardening with in the kernel.

Thanks, Anand


Which in turn can be moved out of
the locked section in btrfs_scrub_dev and the warning is gone. Problem
solved.




  Right. When testing btrfs/011 it got hung and bisect pointed to the
  patch which was converting int to refcount_t.
  I had difficulties to get the logs out of the test machines, so I
  had to drop the patch.
  Will send refcount_t patch, patch 1/3 and possibly scrub concurrency
  patch (make scrub independent of the btrfs-progs locks) patches all
  together.

Thanks, Anand

Reply via email to