]> git.ipfire.org Git - people/arne_f/kernel.git/commit
nfit, address-range-scrub: fix scrub in-progress reporting
authorDan Williams <dan.j.williams@intel.com>
Mon, 2 Apr 2018 23:40:04 +0000 (16:40 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 24 Apr 2018 07:43:02 +0000 (09:43 +0200)
commite041107f06517666cd1a859506e133ee40677a4c
treef3379bffb4a0e408a0b1dfcb38514ee9423951b4
parentc4d2d2ea3fb8829522cea10a5573cb9b372b356c
nfit, address-range-scrub: fix scrub in-progress reporting

commit 78727137fdf49edf9f731bde79d7189067b4047a upstream.

There is a small window whereby ARS scan requests can schedule work that
userspace will miss when polling scrub_show. Hold the init_mutex lock
over calls to report the status to close this potential escape. Also,
make sure that requests to cancel the ARS workqueue are treated as an
idle event.

Cc: <stable@vger.kernel.org>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Fixes: 37b137ff8c83 ("nfit, libnvdimm: allow an ARS scrub...")
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/acpi/nfit/core.c