summaryrefslogtreecommitdiff
path: root/fs/ext4/file.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-14 13:33:39 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-08-14 13:33:39 -0700
commitf75f6ff2eaa626d32dd3225e3008f807741ad1c5 (patch)
tree91446916eff11bc8b900ca4a4a67561021354e53 /fs/ext4/file.c
parentc92316bf8e94830a0225f2e904cbdbd173768419 (diff)
parentef954844c7ace62f773f4f23e28d2d915adc419f (diff)
Merge 4.13-rc5 into driver-core-next
We want the fixes in here as well for testing. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'fs/ext4/file.c')
-rw-r--r--fs/ext4/file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/ext4/file.c b/fs/ext4/file.c
index 58294c9a7e1d..0d7cf0cc9b87 100644
--- a/fs/ext4/file.c
+++ b/fs/ext4/file.c
@@ -537,6 +537,8 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
lastoff = page_offset(page);
bh = head = page_buffers(page);
do {
+ if (lastoff + bh->b_size <= startoff)
+ goto next;
if (buffer_uptodate(bh) ||
buffer_unwritten(bh)) {
if (whence == SEEK_DATA)
@@ -551,6 +553,7 @@ static int ext4_find_unwritten_pgoff(struct inode *inode,
unlock_page(page);
goto out;
}
+next:
lastoff += bh->b_size;
bh = bh->b_this_page;
} while (bh != head);