From mboxrd@z Thu Jan 1 00:00:00 1970 From: Evgeniy Dushistov Subject: Re: [PATCH] ufs: Check if page has buffers before calling page_buffers() Date: Wed, 2 Feb 2011 07:23:47 +0300 Message-ID: <20110202042347.GA3870@maclin> References: <1296595418-2457-1-git-send-email-abogani@kernel.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Tim Bird To: Alessio Igor Bogani Return-path: Content-Disposition: inline In-Reply-To: <1296595418-2457-1-git-send-email-abogani@kernel.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On Tue, Feb 01, 2011 at 10:23:38PM +0100, Alessio Igor Bogani wrote: > In ufs_change_blocknr() we have called page_buffers() without checking if the > page actually had pages attached to it and this could cause a BUG oops. > This looks wrong for me. May be I missed something? Put little more context here. In ufs the tail of small files consists of fragments (usually 2K), the rest of file consists of blocks (usually 16K=8 fragments). When file is growing, and tail become too big (8 fragments) we allocate one block and move content of 8 fragments to it. So in our case we reach (during realocation) point when !page_has_buffers(page) (how?) and in your patch you suggest just ignore such buffer (in terms of ufs - fragments), in other words silently corrupt user data. May be there is better variant? -- /Evgeniy