diff options
author | Jeff Layton <jlayton@primarydata.com> | 2014-08-11 20:09:35 +0200 |
---|---|---|
committer | Jeff Layton <jlayton@primarydata.com> | 2014-08-11 20:24:22 +0200 |
commit | 566709bd627caf933ab8edffaf598203a0c5c8b2 (patch) | |
tree | 5a9b57da3e5b11e827d25dc2b95ff1b36a6701cb /fs | |
parent | locks: show delegations as "DELEG" in /proc/locks (diff) | |
download | linux-566709bd627caf933ab8edffaf598203a0c5c8b2.tar.xz linux-566709bd627caf933ab8edffaf598203a0c5c8b2.zip |
locks: don't call locks_release_private from locks_copy_lock
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>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/locks.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/locks.c b/fs/locks.c index 356667a434c1..2c2d4f5022a7 100644 --- a/fs/locks.c +++ b/fs/locks.c @@ -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; |