Commit 5c88d5d3 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] fix generic_file_write()

The recent writev() fix broke the invariant that ->commit_write _must_ be
called after a successful ->prepare_write().  It leaves ext3 with a
transaction stuck open and the filesystem locks up.
parent ba5cd163
...@@ -1718,10 +1718,9 @@ generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov, ...@@ -1718,10 +1718,9 @@ generic_file_aio_write_nolock(struct kiocb *iocb, const struct iovec *iov,
copied = filemap_copy_from_user_iovec(page, offset, copied = filemap_copy_from_user_iovec(page, offset,
cur_iov, iov_base, bytes); cur_iov, iov_base, bytes);
flush_dcache_page(page); flush_dcache_page(page);
if (likely(copied > 0)) {
status = a_ops->commit_write(file, page, offset, status = a_ops->commit_write(file, page, offset,
offset + copied); offset + copied);
if (likely(copied > 0)) {
if (!status) if (!status)
status = copied; status = copied;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment