xen/xenbus: Count pending messages for each watch
authorSeongJae Park <sjpark@amazon.de>
Mon, 14 Dec 2020 09:07:13 +0000 (10:07 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 30 Dec 2020 10:54:27 +0000 (11:54 +0100)
commit1a72241aabcbb19b52be6f009423e5782b87a09e
tree8096c335de78ba5f519615bfcd1343796bf3e736
parent6835334e154652858651ac6336e71290e0cc1396
xen/xenbus: Count pending messages for each watch

commit 3dc86ca6b4c8cfcba9da7996189d1b5a358a94fc upstream.

This commit adds a counter of pending messages for each watch in the
struct.  It is used to skip unnecessary pending messages lookup in
'unregister_xenbus_watch()'.  It could also be used in 'will_handle'
callback.

This is part of XSA-349

Cc: stable@vger.kernel.org
Signed-off-by: SeongJae Park <sjpark@amazon.de>
Reported-by: Michael Kurth <mku@amazon.de>
Reported-by: Pawel Wieczorkiewicz <wipawel@amazon.de>
Reviewed-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Juergen Gross <jgross@suse.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/xen/xenbus/xenbus_xs.c
include/xen/xenbus.h