From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Message-Id: <20061013143526.15438.56911.sendpatchset@linux.site> In-Reply-To: <20061013143516.15438.8802.sendpatchset@linux.site> References: <20061013143516.15438.8802.sendpatchset@linux.site> Subject: [patch 1/6] mm: revert "generic_file_buffered_write(): handle zero length iovec segments" Date: Fri, 13 Oct 2006 18:44:02 +0200 (CEST) Sender: owner-linux-mm@kvack.org From: Andrew Morton Return-Path: To: Linux Memory Management Cc: Neil Brown , Andrew Morton , Anton Altaparmakov , Chris Mason , Linux Kernel , Nick Piggin List-ID: Revert 81b0c8713385ce1b1b9058e916edcf9561ad76d6. This was a bugfix against 6527c2bdf1f833cc18e8f42bd97973d583e4aa83, which we also revert. Signed-off-by: Andrew Morton Index: linux-2.6/mm/filemap.c =================================================================== --- linux-2.6.orig/mm/filemap.c +++ linux-2.6/mm/filemap.c @@ -1912,12 +1912,6 @@ generic_file_buffered_write(struct kiocb 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); @@ -1947,8 +1941,7 @@ generic_file_buffered_write(struct kiocb page_cache_release(page); continue; } -zero_length_segment: - if (likely(copied >= 0)) { + if (likely(copied > 0)) { if (!status) status = copied; Index: linux-2.6/mm/filemap.h =================================================================== --- linux-2.6.orig/mm/filemap.h +++ linux-2.6/mm/filemap.h @@ -87,7 +87,7 @@ filemap_set_next_iovec(const struct iove 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 iove iov++; base = 0; } - } while (bytes); + } *iovp = iov; *basep = base; } -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org