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] [day] [month] [year] [list]
Message-ID: <20130802191537.GA25558@quack.suse.cz>
Date:	Fri, 2 Aug 2013 21:15:37 +0200
From:	Jan Kara <jack@...e.cz>
To:	Dave Jones <davej@...hat.com>
Cc:	Jan Kara <jack@...e.cz>, Ted Tso <tytso@....edu>,
	linux-ext4@...r.kernel.org, Zheng Liu <gnehzuil.liu@...il.com>
Subject: Re: [PATCH] ext4: Make ext4_writepages() resilient to i_size changes

On Fri 02-08-13 11:26:24, Dave Jones wrote:
> On Fri, Aug 02, 2013 at 04:23:24PM +0200, Jan Kara wrote:
>  > On Thu 01-08-13 00:42:12, Jan Kara wrote:
>  > > Inode size can arbitrarily change while writeback is in progress. This
>  > > can have various strange effects when we use one value of i_size for one
>  > > decision during writeback and another value of i_size for a different
>  > > decision during writeback. In particular a check for lblk < blocks in
>  > > mpage_map_and_submit_buffers() causes problems when i_size is reduced
>  > > while writeback is running because we can end up not using all blocks
>  > > we've allocated. Thus these blocks are leaked and also delalloc
>  > > accounting gets wrong manifesting as a warning like:
>  > > 
>  > > ext4_da_release_space:1333: ext4_da_release_space: ino 12, to_free 1
>  > > with only 0 reserved data blocks
>  > > 
>  > > The problem can happen only when blocksize < pagesize because the check
>  > > for size is performed only after the first iteration of the mapping
>  > > loop.
>  > > 
>  > > Fix the problem by removing the size check from the mapping loop. We
>  > > have an extent allocated so we have to use it all before checking for
>  > > i_size. We may call add_page_bufs_to_extent() unnecessarily but that
>  > > function won't do anything if passed block number is beyond file size.
>  > > 
>  > > Also to avoid future surprises like this sample inode size when
>  > > starting writeback in ext4_writepages() and then use this sampled size
>  > > throughout the writeback call stack.
>  >   Ted, please disregard this patch. It is buggy. I'll send a better fix
>  > soon.
>  
> I was about to post that I was seeing fsx failures on 1k filesystems
> on a kernel with this patch.
> 
> Is that the same thing you're seeing ?
  Likely, I saw fsstress failures with it. But fsx would likely fail as
well - the writing of tail page was hosed.

								Honza
-- 
Jan Kara <jack@...e.cz>
SUSE Labs, CR
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists