]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair doesn't handle unwritten real-time extents properly. When
authorGlen Overby <overby@sgi.com>
Wed, 24 Sep 2003 23:43:37 +0000 (23:43 +0000)
committerGlen Overby <overby@sgi.com>
Wed, 24 Sep 2003 23:43:37 +0000 (23:43 +0000)
the real-time subvolume extent size is larger than a filesystem block,
it is possible to have a real-time extent that is part written and
part unwritten.

Internally, xfs_repair tracks real-time extent use on a per-extent
basis.  Thus, a file that has a written and unwritten extent falling
on the same extent.

This fix addresses this problem specificly by noting when the file
extent is unwritten and covers a partial real-time extent.  Then,
instead of checking that it is unused, it checks that it is used.

repair/dinode.c

index a2740c227325080aa38e221b8e4580a7f7659f22..79ccbee4533be6d429e39db92a5813b9e91e33c3 100644 (file)
@@ -525,6 +525,7 @@ process_bmbt_reclist_int(
        int                     i;
        int                     state;
        int                     flag;           /* extent flag */
+       int                     pwe;            /* partially-written extent */
 
        if (whichfork == XFS_DATA_FORK)
                forkname = _("data");
@@ -633,9 +634,16 @@ process_bmbt_reclist_int(
                         */
                        for (b = s; b < s + c; b += mp->m_sb.sb_rextsize)  {
                                ext = (xfs_drtbno_t) b / mp->m_sb.sb_rextsize;
+                               if (XFS_SB_VERSION_HASEXTFLGBIT(&mp->m_sb) &&
+                                   flag && (b % mp->m_sb.sb_rextsize != 0)) {
+                                       pwe = 1;
+                               } else {
+                                       pwe = 0;
+                               }
 
                                if (check_dups == 1)  {
-                                       if (search_rt_dup_extent(mp, ext))  {
+                                       if (search_rt_dup_extent(mp, ext) &&
+                                           !pwe)  {
                                                do_warn(
        _("data fork in rt ino %llu claims dup rt extent, off - %llu, "
          "start - %llu, count %llu\n"),
@@ -671,6 +679,8 @@ process_bmbt_reclist_int(
        _("%s fork in rt inode %llu found metadata block %llu in %s bmap\n"),
                                                forkname, ino, ext, ftype);
                                case XR_E_INUSE:
+                                       if (pwe)
+                                               break;
                                case XR_E_MULT:
                                        set_rtbno_state(mp, ext, XR_E_MULT);
                                        do_warn(