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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

Looks good.  The b_io_length initialization in xfs_buf_get can also be
removed, but as that's a cosmetic change it can way for 3.6.

Reviewed-by: Christoph Hellwig <hch@xxxxxx>

_______________________________________________
xfs mailing list
xfs@xxxxxxxxxxx
http://oss.sgi.com/mailman/listinfo/xfs


[Index of Archives]     [Linux XFS Devel]     [Linux Filesystem Development]     [Filesystem Testing]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux