Skip to content

Commit

Permalink
locks: don't call locks_release_private from locks_copy_lock
Browse files Browse the repository at this point in the history
All callers of locks_copy_lock pass in a brand new file_lock struct, so
there's no need to call locks_release_private on it. Replace that with
a warning that fires in the event that we receive a target lock that
doesn't look like it's properly initialized.

Acked-by: J. Bruce Fields <bfields@fieldses.org>
Signed-off-by: Jeff Layton <jlayton@primarydata.com>
  • Loading branch information
Jeff Layton committed Aug 11, 2014
1 parent 8144f1f commit 566709b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion fs/locks.c
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ EXPORT_SYMBOL(__locks_copy_lock);

void locks_copy_lock(struct file_lock *new, struct file_lock *fl)
{
locks_release_private(new);
/* "new" must be a freshly-initialized lock */
WARN_ON_ONCE(new->fl_ops);

__locks_copy_lock(new, fl);
new->fl_file = fl->fl_file;
Expand Down

0 comments on commit 566709b

Please sign in to comment.