diff options
Diffstat (limited to 'fs/xfs/xfs_alloc.h')
| -rw-r--r-- | fs/xfs/xfs_alloc.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/fs/xfs/xfs_alloc.h b/fs/xfs/xfs_alloc.h index 650591f999ae..5a4256120ccc 100644 --- a/fs/xfs/xfs_alloc.h +++ b/fs/xfs/xfs_alloc.h | |||
| @@ -44,6 +44,26 @@ typedef enum xfs_alloctype | |||
| 44 | #define XFS_ALLOC_FLAG_FREEING 0x00000002 /* indicate caller is freeing extents*/ | 44 | #define XFS_ALLOC_FLAG_FREEING 0x00000002 /* indicate caller is freeing extents*/ |
| 45 | 45 | ||
| 46 | /* | 46 | /* |
| 47 | * In order to avoid ENOSPC-related deadlock caused by | ||
| 48 | * out-of-order locking of AGF buffer (PV 947395), we place | ||
| 49 | * constraints on the relationship among actual allocations for | ||
| 50 | * data blocks, freelist blocks, and potential file data bmap | ||
| 51 | * btree blocks. However, these restrictions may result in no | ||
| 52 | * actual space allocated for a delayed extent, for example, a data | ||
| 53 | * block in a certain AG is allocated but there is no additional | ||
| 54 | * block for the additional bmap btree block due to a split of the | ||
| 55 | * bmap btree of the file. The result of this may lead to an | ||
| 56 | * infinite loop in xfssyncd when the file gets flushed to disk and | ||
| 57 | * all delayed extents need to be actually allocated. To get around | ||
| 58 | * this, we explicitly set aside a few blocks which will not be | ||
| 59 | * reserved in delayed allocation. Considering the minimum number of | ||
| 60 | * needed freelist blocks is 4 fsbs _per AG_, a potential split of file's bmap | ||
| 61 | * btree requires 1 fsb, so we set the number of set-aside blocks | ||
| 62 | * to 4 + 4*agcount. | ||
| 63 | */ | ||
| 64 | #define XFS_ALLOC_SET_ASIDE(mp) (4 + ((mp)->m_sb.sb_agcount * 4)) | ||
| 65 | |||
| 66 | /* | ||
| 47 | * Argument structure for xfs_alloc routines. | 67 | * Argument structure for xfs_alloc routines. |
| 48 | * This is turned into a structure to avoid having 20 arguments passed | 68 | * This is turned into a structure to avoid having 20 arguments passed |
| 49 | * down several levels of the stack. | 69 | * down several levels of the stack. |
