lkml.org 
[lkml]   [2020]   [Aug]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    SubjectRe: [PATCH] btrfs: fix error value in btrfs_get_extent
    From
    Date


    On 3.08.20 г. 12:35 ч., Pavel Machek wrote:
    > btrfs_get_extent() sets variable ret, but out: error path expect error
    > to be in variable err. Fix that.
    >
    > Signed-off-by: Pavel Machek (CIP) <pavel@denx.de>

    Good catch, this also needs:

    Fixes: 6bf9e4bd6a27 ("btrfs: inode: Verify inode mode to avoid NULL
    pointer dereference")

    Reviewed-by: Nikolay Borisov <nborisov@suse.com>


    >
    > ---
    >
    > Notice that patch introducing this problem is on its way to 4.19.137-stable.
    >
    > diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
    > index 7befb7c12bd3..4aaa01540f89 100644
    > --- a/fs/btrfs/inode.c
    > +++ b/fs/btrfs/inode.c
    > @@ -7012,7 +7012,7 @@ struct extent_map *btrfs_get_extent(struct btrfs_inode *inode,
    > found_type == BTRFS_FILE_EXTENT_PREALLOC) {
    > /* Only regular file could have regular/prealloc extent */
    > if (!S_ISREG(inode->vfs_inode.i_mode)) {
    > - ret = -EUCLEAN;
    > + err = -EUCLEAN;
    > btrfs_crit(fs_info,
    > "regular/prealloc extent found for non-regular inode %llu",
    > btrfs_ino(inode));
    >

    \
     
     \ /
      Last update: 2020-08-03 11:41    [W:4.391 / U:0.808 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site