diff options
author | Andreas Gruenbacher <agruenba@redhat.com> | 2017-06-29 11:43:20 -0700 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2017-07-02 22:46:13 -0700 |
commit | 334fd34d76f237c0ee58dfc400d2c4e34d660544 (patch) | |
tree | 66f3e447de5bc9efc02a7366145ba7730ed49c62 /firmware/cis/NE2K.cis.ihex | |
parent | 7175a11214f02e6184690c17cf5366012b667531 (diff) | |
download | linux-334fd34d76f237c0ee58dfc400d2c4e34d660544.tar.gz linux-334fd34d76f237c0ee58dfc400d2c4e34d660544.tar.bz2 linux-334fd34d76f237c0ee58dfc400d2c4e34d660544.zip |
vfs: Add page_cache_seek_hole_data helper
Both ext4 and xfs implement seeking for the next hole or piece of data
in unwritten extents by scanning the page cache, and both versions share
the same bug when iterating the buffers of a page: the start offset into
the page isn't taken into account, so when a page fits more than two
filesystem blocks, things will go wrong. For example, on a filesystem
with a block size of 1k, the following command will fail:
xfs_io -f -c "falloc 0 4k" \
-c "pwrite 1k 1k" \
-c "pwrite 3k 1k" \
-c "seek -a -r 0" foo
In this example, neither lseek(fd, 1024, SEEK_HOLE) nor lseek(fd, 2048,
SEEK_DATA) will return the correct result.
Introduce a generic vfs helper for seeking in the page cache that gets
this right. The next commits will replace the filesystem specific
implementations.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
[hch: dropped the export]
Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'firmware/cis/NE2K.cis.ihex')
0 files changed, 0 insertions, 0 deletions