On Wed, Jan 24, 2018 at 06:42:42PM +0800, Wei Wang wrote:
What is this doing? Basically handling the case where vq is broken?
It's kind of ugly to tweak feature bits, most code assumes they never
change. Please just return an error to caller instead and handle it
there.
You can then avoid sprinking the check for the feature bit
all over the code.
One thing I don't like about this one is that the previous request
will still try to run to completion.
And it all seems pretty complex.
How about:
- pass cmd id to a queued work
- queued work gets that cmd id, stores a copy and uses that,
re-checking periodically - stop if cmd id changes:
will replace report_free_page too since that's set to
stop.
This means you do not reuse the queued cmd id also
for the buffer - which is probably for the best.