Gitweb:
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4b49643fbb3fa8bf4910f82be02d45e94e8972a4
Commit: 4b49643fbb3fa8bf4910f82be02d45e94e8972a4
Parent: 41cb8ac025dbbf6782eae10d231e7e2336ad3724
Author: Andrew Morton <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 01:24:54 2007 -0700
Committer: Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Tue Oct 16 09:42:54 2007 -0700
Revert "[PATCH] generic_file_buffered_write(): handle zero-length iovec
segments"
This reverts commit 81b0c8713385ce1b1b9058e916edcf9561ad76d6, which was
a bugfix against 6527c2bdf1f833cc18e8f42bd97973d583e4aa83 ("[PATCH]
generic_file_buffered_write(): deadlock on vectored write"), which we
also revert.
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Nick Piggin <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
mm/filemap.c | 9 +--------
mm/filemap.h | 4 ++--
2 files changed, 3 insertions(+), 10 deletions(-)
diff --git a/mm/filemap.c b/mm/filemap.c
index c504db1..caaaa7a 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -1895,12 +1895,6 @@ generic_file_buffered_write(struct kiocb *iocb, const
struct iovec *iov,
break;
}
- if (unlikely(bytes == 0)) {
- status = 0;
- copied = 0;
- goto zero_length_segment;
- }
-
status = a_ops->prepare_write(file, page, offset, offset+bytes);
if (unlikely(status)) {
loff_t isize = i_size_read(inode);
@@ -1930,8 +1924,7 @@ generic_file_buffered_write(struct kiocb *iocb, const
struct iovec *iov,
page_cache_release(page);
continue;
}
-zero_length_segment:
- if (likely(copied >= 0)) {
+ if (likely(copied > 0)) {
if (!status)
status = copied;
diff --git a/mm/filemap.h b/mm/filemap.h
index c2bff04..a1e10a2 100644
--- a/mm/filemap.h
+++ b/mm/filemap.h
@@ -87,7 +87,7 @@ filemap_set_next_iovec(const struct iovec **iovp, size_t
*basep, size_t bytes)
const struct iovec *iov = *iovp;
size_t base = *basep;
- do {
+ while (bytes) {
int copy = min(bytes, iov->iov_len - base);
bytes -= copy;
@@ -96,7 +96,7 @@ filemap_set_next_iovec(const struct iovec **iovp, size_t
*basep, size_t bytes)
iov++;
base = 0;
}
- } while (bytes);
+ }
*iovp = iov;
*basep = base;
}
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at http://vger.kernel.org/majordomo-info.html