[pull] master from linux-nvme:master#241
Merged
Merged
Conversation
The passthru() command derives the file open mode from the data transfer direction encoded in the opcode. However, not all opcodes imply a data transfer direction, leaving the local @flags variable uninitialized. If an input or metadata file is specified for such commands, nvme_open_rawdata() may be called with an uninitialized @flags value. Initialize @flags to an invalid value and fall back to the optional user-specified direction provided through "--read" or "--write" when the direction cannot be inferred from the opcode. Reject input or metadata files if no data transfer direction can be determined and log the appropriate error. Signed-off-by: Fahim Hassan <fahim.hassan@ibm.com>
…stems json_update_subsys() allocates a JSON object up front but returns early for discovery subsystems (whose NQN is not unique) without releasing it, leaking one json_object per discovery subsystem on every config dump. Drop the reference on that early-return path, matching the explicit json_object_put() the no-ports path already does. Signed-off-by: Martin Belanger <martin.belanger@dell.com>
In the host and subsystem definitions of config-schema.json the "required" keyword was nested inside "properties", where JSON Schema treats it as an ordinary property named "required" rather than a constraint. As a result the schema never actually required "hostnqn" on a host or "nqn" on a subsystem. Move "required" up to the object level in both definitions, as the port definition already does. The generated config-schema.json is updated to match its .in source. Signed-off-by: Martin Belanger <martin.belanger@dell.com>
…array
config-schema.json documents the config file as an object with a "hosts"
array, but the code read and wrote a bare top-level array of hosts. The
two had drifted apart with nothing to catch it.
Make the writer emit the object form the schema describes:
{ "hosts": [ ... ] }
and teach the reader to accept both an object (read its "hosts" array)
and a legacy bare array (read it directly). Only the object form is ever
written, so a pre-3.0 file is migrated the next time it is written out --
no separate migration step is needed. The object form also gives the
config a place to carry future top-level keys (e.g. owner) that a bare
array could not.
Convert the test fixtures to the object form and regenerate the expected
dumps. config-pcie-with-tcp-config.json is deliberately kept as a legacy
array to exercise the backward-compatible read path, and config-pcie.json
-- previously a 0-byte file the reader rejected -- becomes a valid empty
config so the test actually dumps something.
Add a config-schema-validate test that checks the dumped fixtures against
config-schema.json, so a future drift between the dump format and the
schema fails CI -- the coverage that was missing when this gap appeared.
It is skipped where the Python jsonschema module is unavailable.
Signed-off-by: Martin Belanger <martin.belanger@dell.com>
The MI transport doesn't support uring yet, thus skip uring auto detection. With this in place, the MI tests will also pass when liburing is enabled. Signed-off-by: Daniel Wagner <wagi@kernel.org>
This is a public interface, thus we should check the input arguments. This also ensures that the no-uring code behaves in the same way as the uring code. Signed-off-by: Daniel Wagner <wagi@kernel.org>
The submit functions are intended for asynchronous command execution, while the exec functions provide synchronous execution. When liburing is enabled, the exec functions use the asynchronous API internally, If a user explicitly chooses the asynchronous API, no internal fallback is provided because the requested behavior is asynchronous execution. In that case, report an error if asynchronous execution is unavailable. Rename all existing functions consistently to reflect their intended semantics. Signed-off-by: Daniel Wagner <wagi@kernel.org>
The liburing configuration needs also be tested, thus add new configuration to the build script. Signed-off-by: Daniel Wagner <wagi@kernel.org>
The direct passthru implementation uses the ioctl interface, and the current naming scheme dates back to a time when ioctl was the only available command execution API. Rename these functions to clearly identify them as the ioctl passthru interface and align them with the command execution naming convention: exec denotes synchronous execution, while submit is reserved for the asynchronous API. No functional changes are intended. Signed-off-by: Daniel Wagner <wagi@kernel.org>
Beautify this header slightly. Signed-off-by: Daniel Wagner <wagi@kernel.org>
The crypto API is a fabrics feature thus only provide this API when fabrics is enabled. Signed-off-by: Daniel Wagner <wagi@kernel.org>
Streamline the global context constructor and don't pass in any arguments. Instead use setters for modifying the context when necessary. Signed-off-by: Daniel Wagner <wagi@kernel.org>
Do not expose the filter helper directly, as it is a platform-specific API. Instead, expose only the libnvme_scan_* interfaces, which provide a more generic abstraction. Adding the global context parameter to this API, where it was previously missing, allows logging and platform abstraction to work consistently. The only current users of the filter API are the Huawei and SFX plugins, both of which rely on behavior that is of questionable value. Rather than codifying such usage patterns, keep the platform-specific filter implementation internal to libnvme. Since there is nothing left of the filter API, rename the files to scan.[ch] Signed-off-by: Daniel Wagner <wagi@kernel.org>
With all Fabrics logic code moved into the library, the only remaining users of this function are internal. Unexport libnvme_host_get_ids() to reduce the public API surface and avoid exposing an interface that is no longer needed by external users. While at it also update the prefix so it clearly states to which part of the library this API belongs. Signed-off-by: Daniel Wagner <wagi@kernel.org>
All the hostnqn/hostid related code is only necessary for the fabrics API, thus move it to the fabrics API and use the correct prefix. Signed-off-by: Daniel Wagner <wagi@kernel.org>
This code implements Linux-specific sysfs handling for the tree API. The Windows port provides the corresponding interfaces in tree-win.c, so move the Linux implementation to tree-linux.c for consistency. Signed-off-by: Daniel Wagner <wagi@kernel.org>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )