}
}
+static void
+locks_check_ctx_file_list(struct file *filp, struct list_head *list,
+ char *list_type)
+{
+ struct file_lock *fl;
+ struct inode *inode = locks_inode(filp);
+
+ list_for_each_entry(fl, list, fl_list)
+ if (fl->fl_file == filp)
+ pr_warn("Leaked %s lock on dev=0x%x:0x%x ino=0x%lx "
+ " fl_owner=%p fl_flags=0x%x fl_type=0x%x fl_pid=%u\n",
+ list_type, MAJOR(inode->i_sb->s_dev),
+ MINOR(inode->i_sb->s_dev), inode->i_ino,
+ fl->fl_owner, fl->fl_flags, fl->fl_type, fl->fl_pid);
+}
+
void
locks_free_lock_context(struct inode *inode)
{
/* remove any leases */
locks_remove_lease(filp, ctx);
+
+ spin_lock(&ctx->flc_lock);
+ locks_check_ctx_file_list(filp, &ctx->flc_posix, "POSIX");
+ locks_check_ctx_file_list(filp, &ctx->flc_flock, "FLOCK");
+ locks_check_ctx_file_list(filp, &ctx->flc_lease, "LEASE");
+ spin_unlock(&ctx->flc_lock);
}
/**