All of lore.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] bdi: add a ->dev_name field to struct backing_dev_info" failed to apply to 5.6-stable tree
@ 2020-05-12 11:51 gregkh
  2020-05-12 14:38 ` Sasha Levin
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2020-05-12 11:51 UTC (permalink / raw)
  To: hch, axboe, bvanassche, jack, yuyufen; +Cc: stable


The patch below does not apply to the 5.6-stable tree.
If someone wants it applied there, or to any other stable or longterm
tree, then please email the backport, including the original git commit
id to <stable@vger.kernel.org>.

thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From 6bd87eec23cbc9ed222bed0f5b5b02bf300e9a8d Mon Sep 17 00:00:00 2001
From: Christoph Hellwig <hch@lst.de>
Date: Mon, 4 May 2020 14:47:56 +0200
Subject: [PATCH] bdi: add a ->dev_name field to struct backing_dev_info

Cache a copy of the name for the life time of the backing_dev_info
structure so that we can reference it even after unregistering.

Fixes: 68f23b89067f ("memcg: fix a crash in wb_workfn when a device disappears")
Reported-by: Yufen Yu <yuyufen@huawei.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Bart Van Assche <bvanassche@acm.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

diff --git a/include/linux/backing-dev-defs.h b/include/linux/backing-dev-defs.h
index ee577a83cfe6..7367150f962a 100644
--- a/include/linux/backing-dev-defs.h
+++ b/include/linux/backing-dev-defs.h
@@ -219,6 +219,7 @@ struct backing_dev_info {
 	wait_queue_head_t wb_waitq;
 
 	struct device *dev;
+	char dev_name[64];
 	struct device *owner;
 
 	struct timer_list laptop_mode_wb_timer;
diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index c2c44c89ee5d..efc5b83acd2d 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -938,7 +938,8 @@ int bdi_register_va(struct backing_dev_info *bdi, const char *fmt, va_list args)
 	if (bdi->dev)	/* The driver needs to use separate queues per device */
 		return 0;
 
-	dev = device_create_vargs(bdi_class, NULL, MKDEV(0, 0), bdi, fmt, args);
+	vsnprintf(bdi->dev_name, sizeof(bdi->dev_name), fmt, args);
+	dev = device_create(bdi_class, NULL, MKDEV(0, 0), bdi, bdi->dev_name);
 	if (IS_ERR(dev))
 		return PTR_ERR(dev);
 
@@ -1047,7 +1048,7 @@ const char *bdi_dev_name(struct backing_dev_info *bdi)
 {
 	if (!bdi || !bdi->dev)
 		return bdi_unknown_name;
-	return dev_name(bdi->dev);
+	return bdi->dev_name;
 }
 EXPORT_SYMBOL_GPL(bdi_dev_name);
 


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] bdi: add a ->dev_name field to struct backing_dev_info" failed to apply to 5.6-stable tree
  2020-05-12 11:51 FAILED: patch "[PATCH] bdi: add a ->dev_name field to struct backing_dev_info" failed to apply to 5.6-stable tree gregkh
@ 2020-05-12 14:38 ` Sasha Levin
  2020-05-12 15:10   ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2020-05-12 14:38 UTC (permalink / raw)
  To: gregkh; +Cc: hch, axboe, bvanassche, jack, yuyufen, stable

On Tue, May 12, 2020 at 01:51:12PM +0200, gregkh@linuxfoundation.org wrote:
>
>The patch below does not apply to the 5.6-stable tree.
>If someone wants it applied there, or to any other stable or longterm
>tree, then please email the backport, including the original git commit
>id to <stable@vger.kernel.org>.
>
>thanks,
>
>greg k-h
>
>------------------ original commit in Linus's tree ------------------
>
>From 6bd87eec23cbc9ed222bed0f5b5b02bf300e9a8d Mon Sep 17 00:00:00 2001
>From: Christoph Hellwig <hch@lst.de>
>Date: Mon, 4 May 2020 14:47:56 +0200
>Subject: [PATCH] bdi: add a ->dev_name field to struct backing_dev_info
>
>Cache a copy of the name for the life time of the backing_dev_info
>structure so that we can reference it even after unregistering.
>
>Fixes: 68f23b89067f ("memcg: fix a crash in wb_workfn when a device disappears")
>Reported-by: Yufen Yu <yuyufen@huawei.com>
>Signed-off-by: Christoph Hellwig <hch@lst.de>
>Reviewed-by: Jan Kara <jack@suse.cz>
>Reviewed-by: Bart Van Assche <bvanassche@acm.org>
>Signed-off-by: Jens Axboe <axboe@kernel.dk>

I've also grabbed eb7ae5e06bb6 ("bdi: move bdi_dev_name out of line") as
a dependency and queued both for 5.6 and 5.4.

-- 
Thanks,
Sasha

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: FAILED: patch "[PATCH] bdi: add a ->dev_name field to struct backing_dev_info" failed to apply to 5.6-stable tree
  2020-05-12 14:38 ` Sasha Levin
@ 2020-05-12 15:10   ` Jens Axboe
  0 siblings, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2020-05-12 15:10 UTC (permalink / raw)
  To: Sasha Levin, gregkh; +Cc: hch, bvanassche, jack, yuyufen, stable

On 5/12/20 8:38 AM, Sasha Levin wrote:
> On Tue, May 12, 2020 at 01:51:12PM +0200, gregkh@linuxfoundation.org wrote:
>>
>> The patch below does not apply to the 5.6-stable tree.
>> If someone wants it applied there, or to any other stable or longterm
>> tree, then please email the backport, including the original git commit
>> id to <stable@vger.kernel.org>.
>>
>> thanks,
>>
>> greg k-h
>>
>> ------------------ original commit in Linus's tree ------------------
>>
>>From 6bd87eec23cbc9ed222bed0f5b5b02bf300e9a8d Mon Sep 17 00:00:00 2001
>> From: Christoph Hellwig <hch@lst.de>
>> Date: Mon, 4 May 2020 14:47:56 +0200
>> Subject: [PATCH] bdi: add a ->dev_name field to struct backing_dev_info
>>
>> Cache a copy of the name for the life time of the backing_dev_info
>> structure so that we can reference it even after unregistering.
>>
>> Fixes: 68f23b89067f ("memcg: fix a crash in wb_workfn when a device disappears")
>> Reported-by: Yufen Yu <yuyufen@huawei.com>
>> Signed-off-by: Christoph Hellwig <hch@lst.de>
>> Reviewed-by: Jan Kara <jack@suse.cz>
>> Reviewed-by: Bart Van Assche <bvanassche@acm.org>
>> Signed-off-by: Jens Axboe <axboe@kernel.dk>
> 
> I've also grabbed eb7ae5e06bb6 ("bdi: move bdi_dev_name out of line") as
> a dependency and queued both for 5.6 and 5.4.

Thanks Sasha!

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-05-12 15:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-12 11:51 FAILED: patch "[PATCH] bdi: add a ->dev_name field to struct backing_dev_info" failed to apply to 5.6-stable tree gregkh
2020-05-12 14:38 ` Sasha Levin
2020-05-12 15:10   ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.