xfs
[Top] [All Lists]

Work around patch to xfs_dfrag.c to keep it from corrupting inodes!

To: linux-xfs@xxxxxxxxxxx
Subject: Work around patch to xfs_dfrag.c to keep it from corrupting inodes!
From: William L Jones <jones@xxxxxxxxxxxxxxxxxx>
Date: Fri, 4 Aug 2000 12:35:45 -0500 (CDT)
Sender: owner-linux-xfs-announce@xxxxxxxxxxx
It can be remvoed when SGI has a fix to bug 791117 

*** xfs_dfrag.c.orig    Fri Aug  4 12:19:14 2000
--- xfs_dfrag.c Fri Aug  4 12:19:26 2000
***************
*** 256,261 ****
--- 256,276 ----
                goto error0;
        }
  
+         /*
+          * IRIX xfs Bug 791117 - Lunux has it to.
+          * Verify that there is enough room for the temp file extents data 
fork.
+          * With out this check the swapext function could corrupt the
+          * target files inode if it has file attribute's.
+        * We just act like it is a busy file so fsr_xfs will do something
+        * reasonable.
+          * Remove when installing sgi patch to this problem.
+          */
+         if (XFS_IFORK_FORMAT(tip, XFS_DATA_FORK) == XFS_DINODE_FMT_EXTENTS &&
+            (tip->i_d.di_nextents * sizeof(xfs_bmbt_rec_t)) > 
XFS_IFORK_DSIZE(ip)) {
+                 error = XFS_ERROR(EBUSY);
+                 goto error0;
+         }
+ 
        /* We need to fail if the file is memory mapped, we also need to
         * prevent it from getting mapped before we have tossed the existing
         * pages. By setting VREMAPPING here we force a pas_vfault to go to

<Prev in Thread] Current Thread [Next in Thread>
  • Work around patch to xfs_dfrag.c to keep it from corrupting inodes!, William L Jones <=