]> git.baikalelectronics.ru Git - kernel.git/commit
locks: fix fasync_struct memory leak in lease upgrade/downgrade handling
authorJeff Layton <jeff.layton@primarydata.com>
Wed, 4 Mar 2015 22:34:32 +0000 (17:34 -0500)
committerJeff Layton <jeff.layton@primarydata.com>
Wed, 4 Mar 2015 22:34:32 +0000 (17:34 -0500)
commit6aab41ca577166718ff3c598765a10d151154a13
treeab038158e85748e6769dea13004c5a9591d10f1a
parent68a50de5887b1215f56ff4a7f259330d9206b2da
locks: fix fasync_struct memory leak in lease upgrade/downgrade handling

Commit a411ee0aefd8 (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 a411ee0aefd8 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: a411ee0aefd8 (locks: convert lease handling to file_lock_context)
Reported-and-Tested-by: Daniel Wagner <daniel.wagner@bmw-carit.de>
Signed-off-by: Jeff Layton <jeff.layton@primarydata.com>
fs/locks.c