From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Piggin Subject: [patch 1/8] 2.6.22-rc4-mm2 buffered write fixes Date: Thu, 14 Jun 2007 04:34:44 +0200 Message-ID: <20070614023444.GA30943@wotan.suse.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, cmm@us.ibm.com, Badari Pulavarty , Dmitriy Monakhov , mark.fasheh@oracle.com To: Andrew Morton Return-path: Received: from ns1.suse.de ([195.135.220.2]:34554 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751088AbXFNCes (ORCPT ); Wed, 13 Jun 2007 22:34:48 -0400 Content-Disposition: inline Sender: linux-fsdevel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org Here are several fixes for issues that Dmitriy found, and also several fixlets for non-compiling filesystems. These only caused one trivial down-stack reject, so I won't worry about sending you the fix for that. These have had some testing with various filesystems, block sizes, and journal modes with fsx-linux, fsstress and swapping-kbuilds. -- Dmitriy noticed some weird code I had in __page_symlink that is wrong. Fixes: fs-introduce-write_begin-write_end-and-perform_write-aops.patch Signed-off-by: Nick Piggin Index: linux-2.6/fs/namei.c =================================================================== --- linux-2.6.orig/fs/namei.c +++ linux-2.6/fs/namei.c @@ -2702,21 +2702,20 @@ int __page_symlink(struct inode *inode, char *kaddr; retry: - err = pagecache_write_begin(NULL, mapping, 0, PAGE_CACHE_SIZE, + err = pagecache_write_begin(NULL, mapping, 0, len-1, AOP_FLAG_UNINTERRUPTIBLE, &page, &fsdata); if (err) goto fail; kaddr = kmap_atomic(page, KM_USER0); memcpy(kaddr, symname, len-1); - memset(kaddr+len-1, 0, PAGE_CACHE_SIZE-(len-1)); kunmap_atomic(kaddr, KM_USER0); - err = pagecache_write_end(NULL, mapping, 0, PAGE_CACHE_SIZE, PAGE_CACHE_SIZE, + err = pagecache_write_end(NULL, mapping, 0, len-1, len-1, page, fsdata); if (err < 0) goto fail; - if (err < PAGE_CACHE_SIZE) + if (err < len-1) goto retry; mark_inode_dirty(inode);