Commit 78f0e33
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.
Fixes: 7b9d14a ("fs: allow mount namespace fd")
Cc: Christian Brauner <brauner@kernel.org>
Signed-off-by: Andrei Vagin <avagin@google.com>
Link: https://patch.msgid.link/20251111062815.2546189-1-avagin@google.com
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Christian Brauner <brauner@kernel.org>1 parent a3f8f86 commit 78f0e33
2 files changed
+17
-17
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
| 145 | + | |
145 | 146 | | |
146 | 147 | | |
147 | 148 | | |
| |||
5726 | 5727 | | |
5727 | 5728 | | |
5728 | 5729 | | |
5729 | | - | |
| 5730 | + | |
5730 | 5731 | | |
5731 | 5732 | | |
5732 | 5733 | | |
| |||
5743 | 5744 | | |
5744 | 5745 | | |
5745 | 5746 | | |
5746 | | - | |
5747 | | - | |
5748 | | - | |
5749 | | - | |
5750 | | - | |
5751 | | - | |
5752 | | - | |
| 5747 | + | |
| 5748 | + | |
| 5749 | + | |
5753 | 5750 | | |
5754 | 5751 | | |
5755 | | - | |
| 5752 | + | |
5756 | 5753 | | |
5757 | 5754 | | |
5758 | 5755 | | |
| |||
5767 | 5764 | | |
5768 | 5765 | | |
5769 | 5766 | | |
| 5767 | + | |
| 5768 | + | |
5770 | 5769 | | |
5771 | 5770 | | |
5772 | 5771 | | |
| |||
5791 | 5790 | | |
5792 | 5791 | | |
5793 | 5792 | | |
5794 | | - | |
5795 | | - | |
| 5793 | + | |
| 5794 | + | |
5796 | 5795 | | |
5797 | 5796 | | |
5798 | 5797 | | |
| |||
5902 | 5901 | | |
5903 | 5902 | | |
5904 | 5903 | | |
5905 | | - | |
5906 | 5904 | | |
| 5905 | + | |
5907 | 5906 | | |
5908 | 5907 | | |
5909 | 5908 | | |
| |||
5917 | 5916 | | |
5918 | 5917 | | |
5919 | 5918 | | |
5920 | | - | |
5921 | | - | |
5922 | | - | |
| 5919 | + | |
| 5920 | + | |
| 5921 | + | |
| 5922 | + | |
5923 | 5923 | | |
5924 | 5924 | | |
5925 | 5925 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
| 200 | + | |
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
| |||
0 commit comments