Skip to content

Commit

Permalink
afs: Fix missing error handling in afs_write_end()
Browse files Browse the repository at this point in the history
afs_write_end() is missing page unlock and put if afs_fill_page() fails.

Reported-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: David Howells <dhowells@redhat.com>
  • Loading branch information
David Howells committed Jan 2, 2018
1 parent 440fbc3 commit afae457
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fs/afs/write.c
Original file line number Diff line number Diff line change
Expand Up @@ -198,18 +198,20 @@ int afs_write_end(struct file *file, struct address_space *mapping,
ret = afs_fill_page(vnode, key, pos + copied,
len - copied, page);
if (ret < 0)
return ret;
goto out;
}
SetPageUptodate(page);
}

set_page_dirty(page);
if (PageDirty(page))
_debug("dirtied");
ret = copied;

out:
unlock_page(page);
put_page(page);

return copied;
return ret;
}

/*
Expand Down

0 comments on commit afae457

Please sign in to comment.