[Devel] [PATCH vz7] ploop: silence ignore discard_granularity vs update in use lockdep warning

Alexander Atanasov alexander.atanasov at virtuozzo.com
Tue Aug 29 20:00:47 MSK 2023


On 28.08.23 16:07, Alexander Atanasov wrote:
> Lockdep reports circular lock dependency here
> &p->lock --> &plo->ctl_mutex --> sb_writers.
> this is only triggered by trinity and it did not happen
> in real world for the last 10 years. fixing it at this stage is not feasible
> since it could break so many things.
> So take the safe route and just disable lockdep when updating the in use header.
> Do this on in use update since there are other places that call sync_write and if there is
> a lock issue with sync_write it would be eventually detected there.
> discard_granylarity sysfs file have .ignore_lockdep set already.
> 
> https://jira.vzint.dev/browse/PSBM-149698
> Signed-off-by: Alexander Atanasov <alexander.atanasov at virtuozzo.com>
> ---
>   drivers/block/ploop/fmt_ploop1.c | 7 +++++++
>   1 file changed, 7 insertions(+)
> 
> diff --git a/drivers/block/ploop/fmt_ploop1.c b/drivers/block/ploop/fmt_ploop1.c
> index e59a9eb50ac2..b0923c8c3659 100644
> --- a/drivers/block/ploop/fmt_ploop1.c
> +++ b/drivers/block/ploop/fmt_ploop1.c
> @@ -313,7 +313,14 @@ ploop1_open(struct ploop_delta * delta)
>   
>   	if (!(delta->flags & PLOOP_FMT_RDONLY)) {
>   		pvd_header_set_disk_in_use(vh);
> +		/*
> +		 * Lockdep reports circular lock dependency here
> +		 * &p->lock --> &plo->ctl_mutex --> sb_writers
> +		 * silence the warning as false positive.
> +		 */
> +		lockdep_off();
>   		err = delta->io.ops->sync_write(&delta->io, ph->dyn_page, 4096, 0, 0);
> +		lockdep_on();
>   		if (err)
>   			goto out_err;
>   	}


Please, ignore , just managed to trigger it again.

-- 
Regards,
Alexander Atanasov



More information about the Devel mailing list