xfs-masters
[Top] [All Lists]

[xfs-masters] [Bug 418] unwritten extents remain unwritten after mmap()

To: xfs-master@xxxxxxxxxxx
Subject: [xfs-masters] [Bug 418] unwritten extents remain unwritten after mmap() modifies them
From: bugzilla-daemon@xxxxxxxxxxx
Date: Thu, 28 Jul 2005 15:53:40 -0700
Reply-to: xfs-masters@xxxxxxxxxxx
Sender: xfs-masters-bounce@xxxxxxxxxxx
http://oss.sgi.com/bugzilla/show_bug.cgi?id=418





------- Additional Comments From wsl-xfs-bugzilla@xxxxxxxx  2005-07-28 15:53 
CST -------
Created an attachment (id=159)
 --> (http://oss.sgi.com/bugzilla/attachment.cgi?id=159&action=view)
test program to trigger the bug

Reserves a region using either XFS_IOC_RESVSP64 or XFS_IOC_ALLOCSP64, then
writes to it using several possible methods.
Particular invocations that demonstrate the bug:

write()ing to the reserved area gives us the expected results:

puin:/tmp/pruts% gcc -Wall -Os -s resv.c -o resv && rm -f blaat && do_write=
./resv 167772160 blaat && ls -lh blaat && du -sh blaat && xfs_bmap -vp blaat
-rw-r--r--  1 wsl wsl 160M 2005-07-27 22:44 blaat
160M    blaat
blaat:
 EXT: FILE-OFFSET       BLOCK-RANGE      AG AG-OFFSET           TOTAL FLAGS
   0: [0..7]:           1149760..1149767  0 (1149760..1149767)      8
   1: [8..163839]:      1149768..1313599  0 (1149768..1313599) 163832 10000
   2: [163840..163847]: 1313600..1313607  0 (1313600..1313607)      8
   3: [163848..327671]: 1313608..1477431  0 (1313608..1477431) 163824 10000
   4: [327672..327679]: 1477432..1477439  0 (1477432..1477439)      8


mmap()ing it then writing to the mapped memory gives us a SIGBUS:

puin:/tmp/pruts% gcc -Wall -Os -s resv.c -o resv && rm -f blaat && do_mmap=
./resv 167772160 blaat && ls -lh blaat && du -sh blaat && xfs_bmap -vp blaat
zsh: 1464 bus error  do_write= do_mmap= ./resv 167772160 blaat


ftruncate()ing it, then mmap()ing it and writing to the mapped memory gives us:


puin:/tmp/pruts% gcc -Wall -Os -s resv.c -o resv && rm -f blaat && do_trunc=
do_mmap= ./resv 167772160 blaat && ls -lh blaat && du -sh blaat && xfs_bmap -vp
blaat
-rw-r--r--  1 wsl wsl 160M 2005-07-27 22:44 blaat
160M    blaat
blaat:
 EXT: FILE-OFFSET      BLOCK-RANGE      AG AG-OFFSET           TOTAL FLAGS
   0: [0..327679]:     1149760..1477439  0 (1149760..1477439) 327680 10000

-- 
Configure bugmail: http://oss.sgi.com/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.


<Prev in Thread] Current Thread [Next in Thread>