[Top] [All Lists]

Re: [PATCH v2] xfs: Fix overallocation in xfs_buf_allocate_memory()

To: Jan Kara <jack@xxxxxxx>
Subject: Re: [PATCH v2] xfs: Fix overallocation in xfs_buf_allocate_memory()
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Wed, 20 Jun 2012 16:41:33 +1000
Cc: xfs@xxxxxxxxxxx, Ben Myers <bpm@xxxxxxx>, Alex Elder <elder@xxxxxxxxxx>, David Chinner <dchinner@xxxxxxxxxx>
In-reply-to: <1338935546-3914-1-git-send-email-jack@xxxxxxx>
References: <1338935546-3914-1-git-send-email-jack@xxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Wed, Jun 06, 2012 at 12:32:26AM +0200, Jan Kara wrote:
> Commit de1cbee which removed b_file_offset in favor of b_bn introduced a bug
> causing xfs_buf_allocate_memory() to overestimate the number of necessary
> pages. The problem is that xfs_buf_alloc() sets b_bn to -1 and thus 
> effectively
> every buffer is straddling a page boundary which causes
> xfs_buf_allocate_memory() to allocate two pages and use vmalloc() for access
> which is unnecessary.
> Dave says xfs_buf_alloc() doesn't need to set b_bn to -1 anymore since the
> buffer is inserted into the cache only after being fully initialized now.
> So just make xfs_buf_alloc() fill in proper block number from the beginning.
> CC: David Chinner <dchinner@xxxxxxxxxx>
> Signed-off-by: Jan Kara <jack@xxxxxxx>

Hmmm, the

Reviewed-by: Dave Chinner <dchinner@xxxxxxxxxx>

I sent yesterday doesn't appear to have made it to the list. Oh
well, try again...


Dave Chinner

<Prev in Thread] Current Thread [Next in Thread>