]> git.baikalelectronics.ru Git - kernel.git/commit
xen-blkfront: Cache feature_persistent value before advertisement
authorSeongJae Park <sj@kernel.org>
Wed, 31 Aug 2022 16:58:24 +0000 (16:58 +0000)
committerJuergen Gross <jgross@suse.com>
Fri, 2 Sep 2022 09:05:15 +0000 (11:05 +0200)
commit698709e9e5a53eeb5162be3c1898e1c42faf0194
tree9a761bc67f2f776c0ba209f2be993e9a04804cdf
parent74b8b4ccb2adee82d19d8530efb70c4fc9ec974e
xen-blkfront: Cache feature_persistent value before advertisement

Xen blkfront advertises its support of the persistent grants feature
when it first setting up and when resuming in 'talk_to_blkback()'.
Then, blkback reads the advertised value when it connects with blkfront
and decides if it will use the persistent grants feature or not, and
advertises its decision to blkfront.  Blkfront reads the blkback's
decision and it also makes the decision for the use of the feature.

Commit 805810b39745 ("xen-blkfront: Apply 'feature_persistent' parameter
when connect"), however, made the blkfront's read of the parameter for
disabling the advertisement, namely 'feature_persistent', to be done
when it negotiate, not when advertise.  Therefore blkfront advertises
without reading the parameter.  As the field for caching the parameter
value is zero-initialized, it always advertises as the feature is
disabled, so that the persistent grants feature becomes always disabled.

This commit fixes the issue by making the blkfront does parmeter caching
just before the advertisement.

Fixes: 805810b39745 ("xen-blkfront: Apply 'feature_persistent' parameter when connect")
Cc: <stable@vger.kernel.org> # 5.10.x
Reported-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Signed-off-by: SeongJae Park <sj@kernel.org>
Tested-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
Reviewed-by: Juergen Gross <jgross@suse.com>
Link: https://lore.kernel.org/r/20220831165824.94815-4-sj@kernel.org
Signed-off-by: Juergen Gross <jgross@suse.com>
drivers/block/xen-blkfront.c