History

fs/namespace: correctly handle errors returned by grab_requested_mnt_ns

grab_requested_mnt_ns was changed to return error codes on failure, but its callers were not updated to check for error pointers, still checking only for a NULL return value. This commit updates the callers to use IS_ERR() or IS_ERR_OR_NULL() and PTR_ERR() to correctly check for and propagate errors. This also makes sure that the logic actually works and mount namespace file descriptors can be used to refere to mounts. Christian Brauner <brauner@kernel.org> says: Rework the patch to be more ergonomic and in line with our overall error handling patterns.

Andrei Vagin committed 1 year ago

Commit 78f0e331 parent a3f8f862 files · +17 −17Browse files

Showing the changes to include/uapi (1 of 2 files). Show all

Unified · Split

include/uapi/linux/mount.h+1−1
@@ -197,7 +197,7 @@ struct statmount { · 196 unmodified lines
197 */197 */
198struct mnt_id_req {198struct mnt_id_req {
199 __u32 size;199 __u32 size;
200 __u32 spare;200 __u32 mnt_ns_fd;
201 __u64 mnt_id;201 __u64 mnt_id;
202 __u64 param;202 __u64 param;
203 __u64 mnt_ns_id;203 __u64 mnt_ns_id;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t