xfs-masters
[Top] [All Lists]

[xfs-masters] [Bug 728] XFS issue with AIO + DIO + sparse files

To: xfs-master@xxxxxxxxxxx
Subject: [xfs-masters] [Bug 728] XFS issue with AIO + DIO + sparse files
From: bugzilla-daemon@xxxxxxxxxxx
Date: Sat, 25 Nov 2006 19:20:07 -0800
Reply-to: xfs-masters@xxxxxxxxxxx
Sender: xfs-masters-bounce@xxxxxxxxxxx
http://oss.sgi.com/bugzilla/show_bug.cgi?id=728





------- Additional Comments From sandeen-xfs@xxxxxxxxxxx  2006-11-25 19:20 CST 
-------
This looks like a core fs problem, I'll see if I can get this fixed upstream.

finished_one_bio calls dio_complete calls xfs_end_io_direct with an offset, but:

offset = dio->iocb->ki_pos;

so this is the -current- post-IO position, not the IO start point that
dio_complete expects.  So, xfs converts the the wrong region.  Ouch!

This seems to fix it up:

Index: linux-2.6.18/fs/direct-io.c
===================================================================
--- linux-2.6.18.orig/fs/direct-io.c
+++ linux-2.6.18/fs/direct-io.c
@@ -256,7 +256,8 @@ static void finished_one_bio(struct dio 
                        if (dio->io_error)
                                transferred = dio->io_error;
 
-                       dio_complete(dio, offset, transferred);
+                       /* dio_complete wants starting point of IO */
+                       dio_complete(dio, offset-transferred, transferred);
 
                        /* Complete AIO later if falling back to buffered i/o */
                        if (dio->result == dio->size ||

[root@magnesium test]# /root/aiodio_sparse_rtc 
[root@magnesium test]# /root/aiodio_sparse_rtc 
[root@magnesium test]# /root/aiodio_sparse_rtc 
[root@magnesium test]# xfs_info . | grep unwritten
         =                       sunit=0      swidth=0 blks, unwritten=1


-- 
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>