]> www.infradead.org Git - nvme.git/commitdiff
xfs: mark xfs_buf_free as might_sleep()
authorChristoph Hellwig <hch@lst.de>
Thu, 20 Mar 2025 07:52:14 +0000 (08:52 +0100)
committerCarlos Maiolino <cem@kernel.org>
Mon, 14 Apr 2025 08:24:30 +0000 (10:24 +0200)
xfs_buf_free can call vunmap, which can sleep.  The vunmap path is an
unlikely one, so add might_sleep to ensure calling xfs_buf_free from
atomic context gets caught more easily.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_buf.c

index 8e7f1b324b3bea132ee93e4ddaa8523fbf17a3a7..1a2b3f06fa717e893a14ff1c9ea3c7c7e127630b 100644 (file)
@@ -105,6 +105,7 @@ xfs_buf_free(
 {
        unsigned int            size = BBTOB(bp->b_length);
 
+       might_sleep();
        trace_xfs_buf_free(bp, _RET_IP_);
 
        ASSERT(list_empty(&bp->b_lru));