• Filipe Manana's avatar
    btrfs: store the error that turned the fs into error state · ae3364e5
    Filipe Manana authored
    Currently when we turn the fs into an error state, typically after a
    transaction abort, we don't store the error anywhere, we just set a bit
    (BTRFS_FS_STATE_ERROR) at struct btrfs_fs_info::fs_state to signal the
    error state.
    
    There are cases where it would be useful to have access to the specific
    error in order to provide a more meaningful error to users/applications.
    This change adds a member to struct btrfs_fs_info to store the error and
    removes the BTRFS_FS_STATE_ERROR bit. When there's no error, the new
    member (fs_error) has a value of 0, otherwise its value is a negative
    errno value.
    
    Followup changes will make use of this new member.
    Signed-off-by: default avatarFilipe Manana <fdmanana@suse.com>
    Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
    ae3364e5
messages.c 8.76 KB