xfs
[Top] [All Lists]

TAKE 988144 - Account for allocated blocks when expanding directories

To: sgi.bugs.xfs@xxxxxxxxxxxx, xfs@xxxxxxxxxxx
Subject: TAKE 988144 - Account for allocated blocks when expanding directories
From: lachlan@xxxxxxx (Lachlan McIlroy)
Date: Wed, 15 Oct 2008 16:47:04 +1100 (EST)
Account for allocated blocks when expanding directories

When we create a directory, we reserve a number of blocks for
the maximum possible expansion of of the directory due to
various btree splits, freespace allocation, etc. Unfortunately,
each allocation is not reflected in the total number of blocks
still available to the transaction, so the maximal reservation
is used over and over again.

This leads to problems where an allocation group has only
enough blocks for *some* of the allocations required for the
directory modification. After the first N allocations, the
remaining blocks in the allocation group drops below the total
reservation, and subsequent allocations fail because the allocator
will not allow the allocation to proceed if the AG does not have
the enough blocks available for the entire allocation total.

This results in an ENOSPC occurring after an allocation has
already occurred. This results in aborting the directory
operation (leaving the directory in an inconsistent state)
and cancelling a dirty transaction, which results in a filesystem
shutdown.

Avoid the problem by reflecting the number of blocks allocated in
any directory expansion in the total number of blocks available to
the modification in progress. This prevents a directory modification
from being aborted part way through with an ENOSPC.

Signed-off-by: Dave Chinner <david@xxxxxxxxxxxxx>

Date:  Wed Oct 15 16:46:37 EST 2008
Workarea:  redback.melbourne.sgi.com:/home/lachlan/isms/2.6.x-reclaim
Inspected by:  lachlan
Author:  lachlan

The following file(s) were checked into:
  longdrop.melbourne.sgi.com:/isms/linux/2.6.x-xfs-melb


Modid:  xfs-linux-melb:xfs-kern:32340a
fs/xfs/xfs_da_btree.c - 1.184 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_da_btree.c.diff?r1=text&tr1=1.184&r2=text&tr2=1.183&f=h
fs/xfs/xfs_dir2.c - 1.70 - changed
http://oss.sgi.com/cgi-bin/cvsweb.cgi/xfs-linux/xfs_dir2.c.diff?r1=text&tr1=1.70&r2=text&tr2=1.69&f=h
        - Account for allocated blocks when expanding directories



<Prev in Thread] Current Thread [Next in Thread>
  • TAKE 988144 - Account for allocated blocks when expanding directories, Lachlan McIlroy <=