1 diff -rupN linux-2.6.18-164.6.1_1//fs/ext4/ialloc.c linux-2.6.18-164.6.1_2//fs/ext4/ialloc.c
2 --- linux-2.6.18-164.6.1_1//fs/ext4/ialloc.c 2010-03-31 17:42:50.000000000 +0530
3 +++ linux-2.6.18-164.6.1_2//fs/ext4/ialloc.c 2010-03-31 17:43:22.000000000 +0530
4 @@ -622,11 +622,14 @@ struct inode *ext4_new_inode_goal(handle
6 trace_mark(ext4_request_inode, "dev %s dir %lu mode %d", sb->s_id,
9 + if (sbi->s_max_dir_size > 0 && i_size_read(dir) >= sbi->s_max_dir_size)
10 + return ERR_PTR(-EFBIG);
12 inode = new_inode(sb);
14 return ERR_PTR(-ENOMEM);
19 goal = sbi->s_inode_goal;
20 diff -rupN linux-2.6.18-164.6.1_1//fs/ext4/super.c linux-2.6.18-164.6.1_2//fs/ext4/super.c
21 --- linux-2.6.18-164.6.1_1//fs/ext4/super.c 2010-03-31 17:42:50.000000000 +0530
22 +++ linux-2.6.18-164.6.1_2//fs/ext4/super.c 2010-03-31 17:45:32.000000000 +0530
24 EXT4_RW_ATTR_SBI_UI(mb_order2_req, s_mb_order2_reqs);
25 EXT4_RW_ATTR_SBI_UI(mb_stream_req, s_mb_stream_request);
26 EXT4_RW_ATTR_SBI_UI(mb_group_prealloc, s_mb_group_prealloc);
27 +EXT4_RW_ATTR_SBI_UI(max_dir_size, s_max_dir_size);
29 static struct attribute *ext4_attrs[] = {
30 ATTR_LIST(delayed_allocation_blocks),
32 ATTR_LIST(mb_order2_req),
33 ATTR_LIST(mb_stream_req),
34 ATTR_LIST(mb_group_prealloc),
35 + ATTR_LIST(max_dir_size),
39 diff -rupN linux-2.6.18-164.6.1_1//fs/ext4/ext4_sb.h linux-2.6.18-164.6.1_2//fs/ext4/ext4_sb.h
40 --- linux-2.6.18-164.6.1_1//fs/ext4/ext4.h 2010-03-31 17:42:50.000000000 +0530
41 +++ linux-2.6.18-164.6.1_2//fs/ext4/ext4.h 2010-03-31 17:43:22.000000000 +0530
42 @@ -119,6 +119,7 @@ struct ext4_sb_info {
43 /* where last allocation was done - for stream allocation */
44 unsigned long s_mb_last_group;
45 unsigned long s_mb_last_start;
46 + unsigned long s_max_dir_size;
48 /* history to debug policy */
49 struct ext4_mb_history *s_mb_history;