You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
btrfs-progs: add error handling for device_get_partition_size_fd_stat()
The function device_get_partition_size_fd_state() has two different
error paths:
- The target file is not a regular nor block file
This should be the common one.
- ioctl failed
This should be very rare.
But it has no way to return error other than returning 0.
This is not helpful for end users to know what's going wrong.
Change that function to return int, and a u64 pointer to return the size
in bytes.
And since we're here, also enhance the error handling of the callers to
do an explicit error message and return error or exit.
Signed-off-by: Qu Wenruo <[email protected]>
0 commit comments