Skip to content
Commit 0164bf02 authored by Jeff Layton's avatar Jeff Layton
Browse files

locks: fix fasync_struct memory leak in lease upgrade/downgrade handling



Commit 8634b51f (locks: convert lease handling to file_lock_context)
introduced a regression in the handling of lease upgrade/downgrades.

In the event that we already have a lease on a file and are going to
either upgrade or downgrade it, we skip doing any list insertion or
deletion and simply re-call lm_setup on the existing lease.

As of commit 8634b51f however, we end up calling lm_setup on the
lease that was passed in, instead of on the existing lease. This causes
us to leak the fasync_struct that was allocated in the event that there
was not already an existing one (as it always appeared that there
wasn't one).

Fixes: 8634b51f (locks: convert lease handling to file_lock_context)
Reported-and-Tested-by: default avatarDaniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: default avatarJeff Layton <jeff.layton@primarydata.com>
parent 6587457b
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment