Repository navigation
Commit ad7e1a7
Btrfs: clean up error handling in btrfs_truncate()
btrfs_truncate() uses two variables for error handling, ret and err (if
this sounds familiar, it's because btrfs_truncate_inode_items() did
something similar). This is error prone, as was made evident by "Btrfs:
fix error handling in btrfs_truncate()". We only have err because we
don't want to mask an error if we call btrfs_update_inode() and
btrfs_end_transaction(), so let's make that its own scoped return
variable and use ret everywhere else.
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
Signed-off-by: Omar Sandoval <osandov@fb.com>
Signed-off-by: David Sterba <dsterba@suse.com>1 parent c5794e5 commit ad7e1a7
1 file changed
Lines changed: 14 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9030 | 9030 | | |
9031 | 9031 | | |
9032 | 9032 | | |
9033 | | - | |
9034 | | - | |
| 9033 | + | |
9035 | 9034 | | |
9036 | 9035 | | |
9037 | 9036 | | |
| |||
9083 | 9082 | | |
9084 | 9083 | | |
9085 | 9084 | | |
9086 | | - | |
| 9085 | + | |
9087 | 9086 | | |
9088 | 9087 | | |
9089 | 9088 | | |
| |||
9107 | 9106 | | |
9108 | 9107 | | |
9109 | 9108 | | |
9110 | | - | |
9111 | | - | |
9112 | | - | |
| 9109 | + | |
9113 | 9110 | | |
9114 | | - | |
9115 | 9111 | | |
9116 | 9112 | | |
9117 | | - | |
9118 | | - | |
| 9113 | + | |
9119 | 9114 | | |
9120 | | - | |
9121 | 9115 | | |
9122 | 9116 | | |
9123 | 9117 | | |
9124 | 9118 | | |
9125 | 9119 | | |
9126 | 9120 | | |
9127 | | - | |
| 9121 | + | |
9128 | 9122 | | |
9129 | 9123 | | |
9130 | 9124 | | |
| |||
9158 | 9152 | | |
9159 | 9153 | | |
9160 | 9154 | | |
| 9155 | + | |
| 9156 | + | |
9161 | 9157 | | |
9162 | | - | |
9163 | | - | |
9164 | | - | |
| 9158 | + | |
| 9159 | + | |
| 9160 | + | |
9165 | 9161 | | |
9166 | | - | |
| 9162 | + | |
| 9163 | + | |
| 9164 | + | |
9167 | 9165 | | |
9168 | 9166 | | |
9169 | 9167 | | |
9170 | 9168 | | |
9171 | 9169 | | |
9172 | | - | |
9173 | | - | |
9174 | | - | |
9175 | | - | |
| 9170 | + | |
9176 | 9171 | | |
9177 | 9172 | | |
9178 | 9173 | | |
| |||
0 commit comments