Skip to content

Commit 5a97247

Browse files
committed
afs: Fix setting of writeback_index
Fix afs_writepages() to always set mapping->writeback_index to a page index and not a byte position[1]. Fixes: 31143d5 ("AFS: implement basic file write support") Reported-by: Marc Dionne <[email protected]> Signed-off-by: David Howells <[email protected]> Reviewed-by: Marc Dionne <[email protected]> cc: [email protected] Link: https://lore.kernel.org/r/CAB9dFdvHsLsw7CMnB+4cgciWDSqVjuij4mH3TaXnHQB8sz5rHw@mail.gmail.com/ [1] Link: https://lore.kernel.org/r/162610728339.3408253.4604750166391496546.stgit@warthog.procyon.org.uk/ # v2 (no v1)
1 parent afe6949 commit 5a97247

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/afs/write.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ int afs_writepages(struct address_space *mapping,
784784
} else if (wbc->range_start == 0 && wbc->range_end == LLONG_MAX) {
785785
ret = afs_writepages_region(mapping, wbc, 0, LLONG_MAX, &next);
786786
if (wbc->nr_to_write > 0 && ret == 0)
787-
mapping->writeback_index = next;
787+
mapping->writeback_index = next / PAGE_SIZE;
788788
} else {
789789
ret = afs_writepages_region(mapping, wbc,
790790
wbc->range_start, wbc->range_end, &next);

0 commit comments

Comments
 (0)