[LU-2479] sanity.sh test_129: max dir size limit work incorrectly. Created: 12/Dec/12  Updated: 25/Apr/14  Resolved: 14/Jun/13

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.2.0, Lustre 2.1.1, Lustre 2.1.2, Lustre 2.1.3, Lustre 1.8.x (1.8.0 - 1.8.5)
Fix Version/s: Lustre 2.6.0, Lustre 2.5.2

Type: Bug Priority: Major
Reporter: Alexey Lyashkov Assignee: WC Triage
Resolution: Fixed Votes: 0
Labels: patch

Issue Links:
Related
is related to LU-4654 sanity test_129: current dir size 122... Resolved
Severity: 3
Rank (Obsolete): 5820

 Description   

easy replicate by hand.
[root@rhel6-64 test1]# for i in `seq 10000000`; do touch $i; done
...
[root@rhel6-64 test1]# echo 16384 >/sys/fs/ldiskfs/loop0/max_dir_size
root@rhel6-64 lustre]# ls -ls
total 256
256 drwxr-xr-x 2 root root 258048 Dec 12 12:28 test1
[root@rhel6-64 lustre]# mkdir test1/proba
mkdir: cannot create directory `test1/proba': File too large
[root@rhel6-64 test1]# echo 0 >/sys/fs/ldiskfs/loop0/max_dir_size
[root@rhel6-64 lustre]# cd test1
[root@rhel6-64 test1]# rm -rf *
[root@rhel6-64 test1]# ls -l
total 0
[root@rhel6-64 test1]# echo 16384 >/sys/fs/ldiskfs/loop0/max_dir_size
[root@rhel6-64 test1]# cd ..
[root@rhel6-64 lustre]# ls -ls
total 264
264 drwxr-xr-x 2 root root 266240 Dec 12 12:28 test1
[root@rhel6-64 lustre]# mkdir test1/proba
mkdir: cannot create directory `test1/proba': File too large
[root@rhel6-64 lustre]#

mkdir failed due wrong assumption - if we allocate an inode that is always allocate a space in directory, but ext4 isn't truncate a directory after removing an objects from it.

that is caused random fails in sanity 129.
+ do_node mft51.xyua 'echo 16384 >/sys/fs/ldiskfs/loop0/max_dir_size'
+ local verbose=false
+ '[' xmft51.xyua = x--verbose ']'
+ local HOST=mft51.xyua
+ shift
+ local 'myPDSH=/usr/bin/pdsh -R ssh -S -w '
+ '[' mft51.xyua = mft51.xyua ']'
+ myPDSH=no_dsh
+ false
+ '[' no_dsh = rsh ']'
+ false
+ sed 's/^mft51.xyua: //'
+ no_dsh mft51.xyua '(PATH=$PATH:/usr/lib64/lustre/utils:/usr/lib64/lustre/tests:/sbin:/usr/sbin; cd /root; LUSTRE="/usr/lib64/lustre" sh -c "echo 16384 >/sys/fs/ldiskfs/loop0/max_dir_size")'
+ shift
+ eval '(PATH=$PATH:/usr/lib64/lustre/utils:/usr/lib64/lustre/tests:/sbin:/usr/sbin;' cd '/root;' 'LUSTRE="/usr/lib64/lustre"' sh -c '"echo' 16384 '>/sys/fs/ldiskfs/loop0/max_dir_size")'
++ PATH=/usr/lib64/lustre/tests/mpi:/usr/lib64/lustre/tests/racer:/usr/lib64/lustre/../lustre-iokit/sgpdd-survey:/usr/lib64/lustre/tests:/usr/lib64/lustre/utils/gss:/usr/lib64/lustre/utils:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/sbin::/usr/lib64/lustre/utils:/usr/lib64/lustre/tests:/sbin:/usr/sbin
++ cd /root
++ LUSTRE=/usr/lib64/lustre
++ sh -c 'echo 16384 >/sys/fs/ldiskfs/loop0/max_dir_size'
+ return 0
+ mkdir -p /mnt/lustre/d0.sanity/d129
mkdir: cannot create directory `/mnt/lustre/d0.sanity': File too large
+ ls -l /mnt/lustre
total 0



 Comments   
Comment by Alexey Lyashkov [ 12/Dec/12 ]

correct implementation landed into ext4 upstream as

commit df981d03eeff7971ac7e6ff37000bfa702327ef1
Author: Theodore Ts'o <tytso@mit.edu>
Date: Fri Aug 17 09:48:17 2012 -0400

ext4: add max_dir_size_kb mount option

by checking a directory limit inside ext4_append function.

Comment by Keith Mannthey (Inactive) [ 16/Jan/13 ]

This same issue has been seen in our test rig.

https://maloo.whamcloud.com/test_sessions/00d6be9e-5fbf-11e2-84d4-52540035b04c

Comment by Keith Mannthey (Inactive) [ 16/Jan/13 ]

Alexey Lyashkov, Have you tested the above change and does it fix the error?

Comment by Alexey Lyashkov [ 20/Jan/13 ]

Keith,

That is correct.
Alexander Boyko <Alexander_Boyko@xyratex.com> work on that issue from Xyratex side and will be ready to submit fix shortly (first inspection round passed).

Comment by Alexander Boyko [ 22/Jan/13 ]

http://review.whamcloud.com/#change,5140

Comment by Alexander Boyko [ 24/Jan/13 ]

http://review.whamcloud.com/#change,5140
Maloo found the issue, it is relate to LU-2640

Comment by Alexander Boyko [ 27/Feb/13 ]

Status update:
I don`t understand why this patch should not be landed if it`s broke SLES11.
1) this patch fix serios bug with simple reproducer, and result is - file creation would failed in empty directory.
2) SLES11 patches are not landed yet.
3) this fix is port from upstream ext4 branch and SLES need to include it also.

Comment by James A Simmons [ 27/Feb/13 ]

New patch address the SLES11 issues. Will work with RHEL6.3, SLES11 SP1 and SP2. Haven't tried it on RHEL6.4 yet.

Comment by Keith Mannthey (Inactive) [ 14/Jun/13 ]

Patch has been merged.

Comment by Vladimir Saveliev [ 01/Nov/13 ]

The directory max size check in ldiskfs_append() should not be applied when an inode does not refer to a directory.
Please take a look
http://review.whamcloud.com/8137

Comment by Emoly Liu [ 24/Apr/14 ]

The directory max size check in ldiskfs_append() should not be applied when an inode does not refer to a directory.
Please take a look
http://review.whamcloud.com/8137

backport to b2_5: http://review.whamcloud.com/10043

Generated at Sat Feb 10 01:25:33 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.