summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2019-12-04 09:33:52 -0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2021-05-19 10:08:30 +0200
commitf78e2c36609b61151b1945c7393facbff3dd1ad6 (patch)
tree341a17c9a413d450fb7e9484e7ecb3a6a84543fc /include
parent3c1db90ae0d0210c0695f63f77458124d83508b2 (diff)
downloadlinux-stable-f78e2c36609b61151b1945c7393facbff3dd1ad6.tar.gz
linux-stable-f78e2c36609b61151b1945c7393facbff3dd1ad6.tar.bz2
linux-stable-f78e2c36609b61151b1945c7393facbff3dd1ad6.zip
iomap: fix sub-page uptodate handling
commit 1cea335d1db1ce6ab71b3d2f94a807112b738a0f upstream. bio completions can race when a page spans more than one file system block. Add a spinlock to synchronize marking the page uptodate. Fixes: 9dc55f1389f9 ("iomap: add support for sub-pagesize buffered I/O without buffer heads") Reported-by: Jan Stancek <jstancek@redhat.com> Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Cc: "Matthew Wilcox (Oracle)" <willy@infradead.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'include')
-rw-r--r--include/linux/iomap.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/iomap.h b/include/linux/iomap.h
index 7aa5d6117936..53b16f104081 100644
--- a/include/linux/iomap.h
+++ b/include/linux/iomap.h
@@ -139,6 +139,7 @@ loff_t iomap_apply(struct inode *inode, loff_t pos, loff_t length,
struct iomap_page {
atomic_t read_count;
atomic_t write_count;
+ spinlock_t uptodate_lock;
DECLARE_BITMAP(uptodate, PAGE_SIZE / 512);
};