lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20061201075341.GB31347@wotan.suse.de>
Date:	Fri, 1 Dec 2006 08:53:41 +0100
From:	Nick Piggin <npiggin@...e.de>
To:	Andrew Morton <akpm@...l.org>
Cc:	OGAWA Hirofumi <hirofumi@...l.parknet.co.jp>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	linux-fsdevel@...r.kernel.org
Subject: Re: [patch 3/3] fs: fix cont vs deadlock patches

On Thu, Nov 30, 2006 at 11:21:02PM -0800, Andrew Morton wrote:
> On Fri, 1 Dec 2006 06:08:52 +0100
> Nick Piggin <npiggin@...e.de> wrote:
> 
> > On Fri, Dec 01, 2006 at 12:41:25PM +0900, OGAWA Hirofumi wrote:
> > > 
> > > Yes, this patch doesn't pass zero-length to prepare_write. However,
> > > I'm not checking this patch is ok for reiserfs...
> > 
> > OK, vfat wasn't working correctly for me -- I needed the following patch:
> 
> Now I'm confused.  What relationship does this patch have to the below?

It is on top of OGAWA Hirofumi's patch, which itself is a replacement
for fs-fix-cont-vs-deadlock-patches.patch. I'll ensure you get the
right one.

> revert-generic_file_buffered_write-handle-zero-length-iovec-segments.patch
> revert-generic_file_buffered_write-deadlock-on-vectored-write.patch
> generic_file_buffered_write-cleanup.patch
> mm-only-mm-debug-write-deadlocks.patch
> mm-fix-pagecache-write-deadlocks.patch
> mm-fix-pagecache-write-deadlocks-comment.patch
> mm-fix-pagecache-write-deadlocks-xip.patch
> mm-fix-pagecache-write-deadlocks-mm-pagecache-write-deadlocks-efault-fix.patch
> mm-fix-pagecache-write-deadlocks-zerolength-fix.patch
> mm-fix-pagecache-write-deadlocks-stale-holes-fix.patch
> fs-prepare_write-fixes.patch
> fs-prepare_write-fixes-fuse-fix.patch
> fs-prepare_write-fixes-jffs-fix.patch
> fs-prepare_write-fixes-fat-fix.patch
> fs-fix-cont-vs-deadlock-patches.patch
> 
> 
> > Index: linux-2.6/fs/buffer.c
> > ===================================================================
> > --- linux-2.6.orig/fs/buffer.c	2006-12-01 15:31:22.000000000 +1100
> > +++ linux-2.6/fs/buffer.c	2006-12-01 16:02:23.000000000 +1100
> > @@ -2102,6 +2102,7 @@
> 
> Please always use `diff -p'

Dang, yes its much better.

> >  			*bytes |= (blocksize-1);
> >  			(*bytes)++;
> >  		}
> > +
> >  		status = __block_prepare_write(inode, new_page, zerofrom,
> >  						PAGE_CACHE_SIZE, get_block);
> >  		if (status)
> > @@ -2110,7 +2111,7 @@
> >  		memset(kaddr+zerofrom, 0, PAGE_CACHE_SIZE-zerofrom);
> >  		flush_dcache_page(new_page);
> >  		kunmap_atomic(kaddr, KM_USER0);
> > -		generic_commit_write(NULL, new_page, zerofrom, PAGE_CACHE_SIZE);
> > +		__block_commit_write(inode, new_page, zerofrom, PAGE_CACHE_SIZE);
> 
> Whatever function this is doesn't need to update i_size?

Yes, it is the code in cont_prepare_write that is expanding a hole
at the end of file.

We can do this now because fat_commit_write is now changed to call
generic_commit_write in the case of a non-zero length.

I think it is an improvement because now the file will not get
arbitrarily extended in the case of a write failure somewhere down
the track.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ