Patch "dax/bus.c: use the right locking mode (read vs write) in size_show" has been added to the 6.9-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    dax/bus.c: use the right locking mode (read vs write) in size_show

to the 6.9-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     dax-bus.c-use-the-right-locking-mode-read-vs-write-i.patch
and it can be found in the queue-6.9 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 2eda4622187bf637375c484dfe4ebc870298c108
Author: Vishal Verma <vishal.l.verma@xxxxxxxxx>
Date:   Tue Apr 30 11:44:26 2024 -0600

    dax/bus.c: use the right locking mode (read vs write) in size_show
    
    [ Upstream commit 2acf04532d6d655d8c3b2ee4ddeb320107043086 ]
    
    In size_show(), the dax_dev_rwsem only needs a read lock, but was
    acquiring a write lock.  Change it to down_read_interruptible() so it
    doesn't unnecessarily hold a write lock.
    
    Link: https://lkml.kernel.org/r/20240430-vv-dax_abi_fixes-v3-4-e3dcd755774c@xxxxxxxxx
    Fixes: c05ae9d85b47 ("dax/bus.c: replace driver-core lock usage by a local rwsem")
    Signed-off-by: Vishal Verma <vishal.l.verma@xxxxxxxxx>
    Reviewed-by: Dan Williams <dan.j.williams@xxxxxxxxx>
    Cc: Alison Schofield <alison.schofield@xxxxxxxxx>
    Cc: Dave Jiang <dave.jiang@xxxxxxxxx>
    Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c
index 0011a6e6a8f2a..f24b67c64d5ec 100644
--- a/drivers/dax/bus.c
+++ b/drivers/dax/bus.c
@@ -937,11 +937,11 @@ static ssize_t size_show(struct device *dev,
 	unsigned long long size;
 	int rc;
 
-	rc = down_write_killable(&dax_dev_rwsem);
+	rc = down_read_interruptible(&dax_dev_rwsem);
 	if (rc)
 		return rc;
 	size = dev_dax_size(dev_dax);
-	up_write(&dax_dev_rwsem);
+	up_read(&dax_dev_rwsem);
 
 	return sysfs_emit(buf, "%llu\n", size);
 }




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux