Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65a15109 authored by David Howells's avatar David Howells
Browse files

afs: ->writepage() shouldn't call clear_page_dirty_for_io()



The ->writepage() op shouldn't call clear_page_dirty_for_io() as that has
already been called by the caller.

Fix afs_writepage() by moving the call out of
afs_write_back_from_locked_page() to afs_writepages_region() where it is
needed.

Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
parent 954cd6dc
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -231,7 +231,7 @@ int afs_write_begin(struct file *file, struct address_space *mapping,
	if (wb->state == AFS_WBACK_PENDING)
		wb->state = AFS_WBACK_CONFLICTING;
	spin_unlock(&vnode->writeback_lock);
	if (PageDirty(page)) {
	if (clear_page_dirty_for_io(page)) {
		ret = afs_write_back_from_locked_page(wb, page);
		if (ret < 0) {
			afs_put_writeback(candidate);
@@ -353,8 +353,6 @@ static int afs_write_back_from_locked_page(struct afs_writeback *wb,
	_enter(",%lx", primary_page->index);

	count = 1;
	if (!clear_page_dirty_for_io(primary_page))
		BUG();
	if (test_set_page_writeback(primary_page))
		BUG();

@@ -542,6 +540,8 @@ static int afs_writepages_region(struct address_space *mapping,
		wb->state = AFS_WBACK_WRITING;
		spin_unlock(&wb->vnode->writeback_lock);

		if (!clear_page_dirty_for_io(page))
			BUG();
		ret = afs_write_back_from_locked_page(wb, page);
		unlock_page(page);
		put_page(page);