Bug 706361 - gfs2 filesystem gets corrupted when full
Summary: gfs2 filesystem gets corrupted when full
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel
Version: 5.7
Hardware: Unspecified
OS: Linux
unspecified
unspecified
Target Milestone: rc
: ---
Assignee: Robert Peterson
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-05-20 09:07 UTC by Martin Juricek
Modified: 2011-05-23 16:20 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-05-23 16:20:50 UTC
Target Upstream Version:


Attachments (Terms of Use)

Description Martin Juricek 2011-05-20 09:07:04 UTC
When you try to create files on a full gfs2 filesystem, it gets corrupted.


Steps to Reproduce:
1. create gfs2 filesystem
2. fill it to 100%
3. try to create zero-sized files on it
  
Actual results:
gfs2 is corrupted, fsck.gfs2 reports unlinked node

Expected results:
no gfs2 corruption


Additional info:

(03:44:23) [root@a3:/opt]$ uname -a
Linux a3 2.6.18-261.el5 #1 SMP Thu May 12 16:47:19 EDT 2011 ia64 ia64 ia64 GNU/Linux
(03:45:15) [root@a3:/opt]$ rpm -q gfs2-utils
gfs2-utils-0.1.62-30.el5


(03:41:48) [root@a3:/opt]$ mkfs.gfs2 -p lock_nolock /dev/loop0 -O
Device:                    /dev/loop0
Blocksize:                 4096
Device Size                2.00 GB (524288 blocks)
Filesystem Size:           2.00 GB (524288 blocks)
Journals:                  1
Resource Groups:           8
Locking Protocol:          "lock_nolock"
Lock Table:                ""
UUID:                      423DED38-CE9B-3DDE-90EE-5DB7D2349158

(03:42:28) [root@a3:/opt]$ mount /dev/loop0 /mnt/test
(03:42:32) [root@a3:/opt]$ dd if=/dev/zero of=/mnt/test/file1914M bs=957M count=2
2+0 records in
2+0 records out
2006974464 bytes (2.0 GB) copied, 4.17574 seconds, 481 MB/s
(03:42:46) [root@a3:/opt]$ df -h | grep loop0
/dev/loop0            2.0G  2.0G  704K 100% /mnt/test
(03:42:51) [root@a3:/opt]$ umount /mnt/test
(03:43:03) [root@a3:/opt]$ fsck.gfs2 -n /dev/loop0
Initializing fsck
Validating Resource Group index.
Level 1 RG check.
(level 1 passed)
Starting pass1
Pass1 complete      
Starting pass1b
Pass1b complete
Starting pass1c
Pass1c completeete.
Starting pass2
Pass2 complete      
Starting pass3
Pass3 complete      
Starting pass4
Pass4 complete      
Starting pass5
Pass5 complete      
gfs2_fsck complete    
(03:43:21) [root@a3:/opt]$ mount /dev/loop0 /mnt/test
(03:43:39) [root@a3:/opt]$ i=0; while [ $? -eq 0 ]; do ((i++)); touch /mnt/test/zerofile.$i ; done
touch: cannot touch `/mnt/test/zerofile.67': No space left on device
(03:43:50) [root@a3:/opt]$ df -h | grep loop0
/dev/loop0            2.0G  2.0G  168K 100% /mnt/test
(03:44:00) [root@a3:/opt]$ umount /mnt/test
(03:44:10) [root@a3:/opt]$ fsck.gfs2 -n /dev/loop0
Initializing fsck
Validating Resource Group index.
Level 1 RG check.
(level 1 passed)
Starting pass1
Pass1 complete      
Starting pass1b
Pass1b complete
Starting pass1c
Pass1c complete
Starting pass2
Pass2 complete      
Starting pass3
Pass3 complete      
Starting pass4
Found unlinked inode at 458747 (0x6fffb)
Unlinked inode left unlinked
Pass4 complete      
Starting pass5
Pass5 complete      
gfs2_fsck complete    
(03:44:23) [root@a3:/opt]$

Comment 1 Steve Whitehouse 2011-05-23 11:52:57 UTC
Note that this only happens when there is no free space in the directory and thus the inode creation needs an extra block. In that case an unlinked inode can be left on the fs which will be cleaned up by (a) the next fsck or (b) the next attempt at allocation.

This is working as designed, even though it may seem a bit odd at first sight. SO if there is not any other issue, we can close this a notabug I think.

Also, I've corrected the component since this is gfs2 and not gfs.

Comment 2 Martin Juricek 2011-05-23 16:20:50 UTC
OK, thank you for the explanation.


Note You need to log in before you can comment on or make changes to this bug.