All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cont_prepare_write question
@ 2003-07-21 19:45 Eli Carter
  0 siblings, 0 replies; only message in thread
From: Eli Carter @ 2003-07-21 19:45 UTC (permalink / raw)
  To: linux-fsdevel

 From a very basic look at cont_prepare_write() in fs/buffer.c, it looks 
like it needs this patch to prevent an infinite loop when extending a 
file by several blocks.  (>8 for the 0.5k block case)

--- linux-2.5.68-rmk1/fs/buffer.c	2003/04/22 15:13:04	1.1.2.3
+++ linux-2.5.68-rmk1/fs/buffer.c	2003/07/21 19:38:40
@@ -2118,6 +2118,7 @@
  			goto out_unmap;
  		kaddr = kmap_atomic(new_page, KM_USER0);
  		memset(kaddr+zerofrom, 0, PAGE_CACHE_SIZE-zerofrom);
+		*bytes += PAGE_CACHE_SIZE-zerofrom;
  		flush_dcache_page(new_page);
  		kunmap_atomic(kaddr, KM_USER0);
  		__block_commit_write(inode, new_page,

I'm not going to pretend that I understand why, or what this exactly 
accomplishes... it just seems to improve things somewhat in my case.  If 
someone could give a basic explanation of what is going on in this loop, 
particularly in regards to how the loop is supposed to end, or a pointer 
to something to read that would make this function clearer than mud, I'd 
be very grateful.

Thanks,

Eli
--------------------. "If it ain't broke now,
Eli Carter           \                  it will be soon." -- crypto-gram
eli.carter(a)inet.com `-------------------------------------------------


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-07-21 19:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-21 19:45 [PATCH] cont_prepare_write question Eli Carter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.