]> Git Repo - linux.git/commitdiff
bcache: don't pass a stack address to blkdev_get_by_path
authorChristoph Hellwig <[email protected]>
Thu, 8 Jun 2023 11:02:40 +0000 (13:02 +0200)
committerJens Axboe <[email protected]>
Mon, 12 Jun 2023 14:04:04 +0000 (08:04 -0600)
sb is just an on-stack pointer that can easily be reused by other calls.
Switch to use the bcache-wide bcache_kobj instead as there is no need to
claim per-bcache device anyway.

Signed-off-by: Christoph Hellwig <[email protected]>
Reviewed-by: Hannes Reinecke <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Jens Axboe <[email protected]>
drivers/md/bcache/super.c

index 94b91c45c9e2a97b81ce46c4e2925680b3f54f33..4a2aed047aec1216ae66ab0c016efb90a843143d 100644 (file)
@@ -2560,7 +2560,7 @@ static ssize_t register_bcache(struct kobject *k, struct kobj_attribute *attr,
        err = "failed to open device";
        bdev = blkdev_get_by_path(strim(path),
                                  FMODE_READ|FMODE_WRITE|FMODE_EXCL,
-                                 sb, NULL);
+                                 bcache_kobj, NULL);
        if (IS_ERR(bdev)) {
                if (bdev == ERR_PTR(-EBUSY)) {
                        dev_t dev;
This page took 0.054691 seconds and 4 git commands to generate.