On 2020/3/23 22:04, Greg KH wrote:
On Mon, Mar 23, 2020 at 09:22:54PM +0800, Yufen Yu wrote:
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 82d2401fec37..1c0e2d0d6236 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -525,12 +525,16 @@ static inline const char *bdi_dev_name(struct backing_dev_info *bdi)
static inline char *bdi_get_dev_name(struct backing_dev_info *bdi,
char *dname, int len)
{
+ spin_lock_irq(&bdi->lock);
if (!bdi || !bdi->dev) {
+ spin_unlock_irq(&bdi->lock);
You can't test for (!bdi) right after you accessed bdi->lock :(
Sorry for this coding error.
Thanks,
Yufen