xfs-masters
[Top] [All Lists]

[Bug 850] XFS file system segfaults , repeatedly and 100 % reproducable

To: xfs-masters@xxxxxxxxxxx
Subject: [Bug 850] XFS file system segfaults , repeatedly and 100 % reproducable in 2.6.30 , 2.6.31
From: bugzilla-daemon@xxxxxxxxxxx
Date: Wed, 23 Sep 2009 00:05:50 -0500
Auto-submitted: auto-generated
In-reply-to: <bug-850-113@xxxxxxxxxxxxxxxx/bugzilla/>
References: <bug-850-113@xxxxxxxxxxxxxxxx/bugzilla/>
http://oss.sgi.com/bugzilla/show_bug.cgi?id=850





--- Comment #20 from Eric Sandeen <sandeen-xfs@xxxxxxxxxxx>  2009-09-23 
00:05:49 CST ---
Basic problem seems to be that we had to take a guess at the readdir bufsize
(see xfs_file_readdir comments).

xfs_dir2_leaf_getdents() decrements bufsize as it goes, and eventually that
goes negative.  This adversely affects the readahead window calculations etc
and munges up some other logic, causing us to call into xfs_bmapi() asking for
0 maps.  </hand_wave> - still need to see just where that is but it's late now
for me ;)

This patch:

Index: linux/fs/xfs/xfs_dir2_leaf.c
===================================================================
--- linux.orig/fs/xfs/xfs_dir2_leaf.c
+++ linux/fs/xfs/xfs_dir2_leaf.c
@@ -1089,6 +1089,7 @@ xfs_dir2_leaf_getdents(
         ptr += length;
         curoff += length;
         bufsize -= length;
+        if ((int)bufsize < 0) bufsize = 0;
     }

     /*

stops bufsize from going negative and keeps things sane, but it's ugly.

Will sort out final details of the problem & a better patch tomorrow I hope.

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

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