]> git.baikalelectronics.ru Git - kernel.git/commit
nvme: simplify error logic in nvme_validate_ns()
authorHannes Reinecke <hare@suse.de>
Fri, 26 Feb 2021 07:17:25 +0000 (08:17 +0100)
committerChristoph Hellwig <hch@lst.de>
Thu, 11 Mar 2021 10:48:34 +0000 (11:48 +0100)
commitb95af503057aab5b8704c4acacf918307bf5d5e3
tree44b285babf5401ce9c111d50940f4e8a15449874
parente67061a96a6e6b013bb4238ff2c4a78c69a6f0e0
nvme: simplify error logic in nvme_validate_ns()

We only should remove namespaces when we get fatal error back from
the device or when the namespace IDs have changed.
So instead of painfully masking out error numbers which might indicate
that the error should be ignored we could use an NVME status code
to indicated when the namespace should be removed.
That simplifies the final logic and makes it less error-prone.

Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/host/core.c