lkml.org 
[lkml]   [2016]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3.13.y-ckt 041/136] bcache: allows use of register in udev to avoid "device_busy" error.
    Date
    3.13.11-ckt34 -stable review patch.  If anyone has any objections, please let me know.

    ---8<------------------------------------------------------------

    From: Gabriel de Perthuis <g2p.code@gmail.com>

    commit d7076f21629f8f329bca4a44dc408d94670f49e2 upstream.

    Allows to use register, not register_quiet in udev to avoid "device_busy" error.
    The initial patch proposed at https://lkml.org/lkml/2013/8/26/549 by Gabriel de Perthuis
    <g2p.code@gmail.com> does not unlock the mutex and hangs the kernel.

    See http://thread.gmane.org/gmane.linux.kernel.bcache.devel/2594 for the discussion.

    Cc: Denis Bychkov <manover@gmail.com>
    Cc: Kent Overstreet <kent.overstreet@gmail.com>
    Cc: Eric Wheeler <bcache@linux.ewheeler.net>
    Cc: Gabriel de Perthuis <g2p.code@gmail.com>

    Signed-off-by: Jens Axboe <axboe@fb.com>
    Signed-off-by: Kamal Mostafa <kamal@canonical.com>
    ---
    drivers/md/bcache/super.c | 5 +++--
    1 file changed, 3 insertions(+), 2 deletions(-)

    diff --git a/drivers/md/bcache/super.c b/drivers/md/bcache/super.c
    index 0b937fb..ccc0133 100644
    --- a/drivers/md/bcache/super.c
    +++ b/drivers/md/bcache/super.c
    @@ -1927,6 +1927,8 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
    else
    err = "device busy";
    mutex_unlock(&bch_register_lock);
    + if (attr == &ksysfs_register_quiet)
    + goto out;
    }
    goto err;
    }
    @@ -1964,8 +1966,7 @@ out:
    err_close:
    blkdev_put(bdev, FMODE_READ|FMODE_WRITE|FMODE_EXCL);
    err:
    - if (attr != &ksysfs_register_quiet)
    - pr_info("error opening %s: %s", path, err);
    + pr_info("error opening %s: %s", path, err);
    ret = -EINVAL;
    goto out;
    }
    --
    1.9.1
    \
     
     \ /
      Last update: 2016-02-02 19:21    [W:6.186 / U:0.292 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site