Commit 6240f43
ublk: enhance check for register/unregister io buffer command
The simple check of UBLK_IO_FLAG_OWNED_BY_SRV can avoid incorrect
register/unregister io buffer easily, so check it before calling
starting to register/un-register io buffer.
Also only allow io buffer register/unregister uring_cmd in case of
UBLK_F_SUPPORT_ZERO_COPY.
Also mark argument 'ublk_queue *' of ublk_register_io_buf as const.
Reviewed-by: Caleb Sander Mateos <csander@purestorage.com>
Fixes: 1f6540e ("ublk: zc register/unregister bvec")
Signed-off-by: Ming Lei <ming.lei@redhat.com>
Link: https://lore.kernel.org/r/20250429022941.1718671-4-ming.lei@redhat.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 69edf98 commit 6240f43
1 file changed
Lines changed: 20 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
| |||
1949 | 1949 | | |
1950 | 1950 | | |
1951 | 1951 | | |
1952 | | - | |
| 1952 | + | |
1953 | 1953 | | |
1954 | 1954 | | |
1955 | 1955 | | |
| 1956 | + | |
1956 | 1957 | | |
1957 | 1958 | | |
1958 | 1959 | | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
1959 | 1966 | | |
1960 | 1967 | | |
1961 | 1968 | | |
| |||
1971 | 1978 | | |
1972 | 1979 | | |
1973 | 1980 | | |
| 1981 | + | |
1974 | 1982 | | |
1975 | 1983 | | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
| 1991 | + | |
1976 | 1992 | | |
1977 | 1993 | | |
1978 | 1994 | | |
| |||
2076 | 2092 | | |
2077 | 2093 | | |
2078 | 2094 | | |
2079 | | - | |
| 2095 | + | |
2080 | 2096 | | |
2081 | 2097 | | |
2082 | 2098 | | |
| |||
2128 | 2144 | | |
2129 | 2145 | | |
2130 | 2146 | | |
2131 | | - | |
| 2147 | + | |
2132 | 2148 | | |
2133 | 2149 | | |
2134 | 2150 | | |
| |||
0 commit comments