Commit 6c55732
btrfs: fix lost error when running device stats on multiple devices fs
[ Upstream commit 1c37d89 ]
Whenever we get an error updating the device stats item for a device in
btrfs_run_dev_stats() we allow the loop to go to the next device, and if
updating the stats item for the next device succeeds, we end up losing
the error we had from the previous device.
Fix this by breaking out of the loop once we get an error and make sure
it's returned to the caller. Since we are in the transaction commit path
(and in the critical section actually), returning the error will result
in a transaction abort.
Fixes: 733f4fb ("Btrfs: read device stats on mount, write modified ones during commit")
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>1 parent 3c645c6 commit 6c55732
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7874 | 7874 | | |
7875 | 7875 | | |
7876 | 7876 | | |
7877 | | - | |
7878 | | - | |
| 7877 | + | |
| 7878 | + | |
| 7879 | + | |
7879 | 7880 | | |
7880 | 7881 | | |
7881 | 7882 | | |
| |||
0 commit comments