lkml.org 
[lkml]   [2015]   [Jun]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.0 092/105] md: dont return 0 from array_state_store
    Date
    4.0-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: NeilBrown <neilb@suse.de>

    commit c008f1d356277a5b7561040596a073d87e56b0c8 upstream.

    Returning zero from a 'store' function is bad.
    The return value should be either len length of the string
    or an error.

    So use 'len' if 'err' is zero.

    Fixes: 6791875e2e53 ("md: make reconfig_mutex optional for writes to md sysfs files.")
    Signed-off-by: NeilBrown <neilb@suse.de>
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

    ---
    drivers/md/md.c | 2 +-
    1 file changed, 1 insertion(+), 1 deletion(-)

    --- a/drivers/md/md.c
    +++ b/drivers/md/md.c
    @@ -3765,7 +3765,7 @@ array_state_store(struct mddev *mddev, c
    err = -EBUSY;
    }
    spin_unlock(&mddev->lock);
    - return err;
    + return err ?: len;
    }
    err = mddev_lock(mddev);
    if (err)

    --
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2015-06-19 23:01    [W:4.151 / U:0.240 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site