Commit ba5afb9
committed
fs: rework listmount() implementation
Linus pointed out that there's error handling and naming issues in the
that we should rewrite:
* Perform the access checks for the buffer before actually doing any
work instead of doing it during the iteration.
* Rename the arguments to listmount() and do_listmount() to clarify what
the arguments are used for.
* Get rid of the pointless ctr variable and overflow checking.
* Get rid of the pointless speculation check.
Link: https://lore.kernel.org/r/CAHk-=wjh6Cypo8WC-McXgSzCaou3UXccxB+7PVeSuGR8AjCphg@mail.gmail.com
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Christian Brauner <brauner@kernel.org>1 parent 7ea26f9 commit ba5afb9
2 files changed
Lines changed: 29 additions & 23 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5042 | 5042 | | |
5043 | 5043 | | |
5044 | 5044 | | |
5045 | | - | |
5046 | | - | |
5047 | | - | |
| 5045 | + | |
| 5046 | + | |
| 5047 | + | |
5048 | 5048 | | |
5049 | 5049 | | |
5050 | | - | |
5051 | | - | |
| 5050 | + | |
5052 | 5051 | | |
5053 | 5052 | | |
5054 | 5053 | | |
| |||
5058 | 5057 | | |
5059 | 5058 | | |
5060 | 5059 | | |
5061 | | - | |
5062 | | - | |
5063 | | - | |
| 5060 | + | |
| 5061 | + | |
| 5062 | + | |
5064 | 5063 | | |
5065 | | - | |
5066 | | - | |
| 5064 | + | |
| 5065 | + | |
5067 | 5066 | | |
5068 | 5067 | | |
5069 | 5068 | | |
5070 | | - | |
5071 | | - | |
| 5069 | + | |
5072 | 5070 | | |
5073 | | - | |
5074 | | - | |
| 5071 | + | |
| 5072 | + | |
| 5073 | + | |
5075 | 5074 | | |
5076 | | - | |
| 5075 | + | |
5077 | 5076 | | |
5078 | 5077 | | |
5079 | | - | |
5080 | | - | |
| 5078 | + | |
| 5079 | + | |
5081 | 5080 | | |
5082 | 5081 | | |
5083 | 5082 | | |
5084 | 5083 | | |
5085 | 5084 | | |
5086 | | - | |
| 5085 | + | |
| 5086 | + | |
5087 | 5087 | | |
5088 | 5088 | | |
5089 | 5089 | | |
5090 | 5090 | | |
5091 | 5091 | | |
| 5092 | + | |
| 5093 | + | |
| 5094 | + | |
| 5095 | + | |
| 5096 | + | |
| 5097 | + | |
5092 | 5098 | | |
5093 | 5099 | | |
5094 | 5100 | | |
5095 | | - | |
| 5101 | + | |
5096 | 5102 | | |
5097 | 5103 | | |
5098 | 5104 | | |
5099 | 5105 | | |
5100 | | - | |
| 5106 | + | |
5101 | 5107 | | |
5102 | 5108 | | |
5103 | 5109 | | |
5104 | | - | |
| 5110 | + | |
5105 | 5111 | | |
5106 | 5112 | | |
5107 | 5113 | | |
| |||
5111 | 5117 | | |
5112 | 5118 | | |
5113 | 5119 | | |
5114 | | - | |
| 5120 | + | |
5115 | 5121 | | |
5116 | 5122 | | |
5117 | 5123 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
414 | 414 | | |
415 | 415 | | |
416 | 416 | | |
417 | | - | |
| 417 | + | |
418 | 418 | | |
419 | 419 | | |
420 | 420 | | |
| |||
0 commit comments