kern/149208: mksnap_ffs(8) hang/deadlock

Коньков Евгений kes-kes at yandex.ru
Fri Dec 9 05:00:24 UTC 2011


The following reply was made to PR kern/149208; it has been noted by GNATS.

From: =?windows-1251?B?yu7t/Oru4iDF4uPl7ejp?= <kes-kes at yandex.ru>
To: bug-followup at FreeBSD.org, karl at denninger.net
Cc:  
Subject: Re: kern/149208: mksnap_ffs(8) hang/deadlock
Date: Fri, 9 Dec 2011 06:58:51 +0200

 Hi
 as adviced here
 http://unix.derkeiler.com/Mailing-Lists/FreeBSD/stable/2008-11/msg00210.html
 
 I think you need to add
 > + if (cg % 10 == 0)
 > + ffs_syncvnode(vp, MNT_WAIT);
 in any loop, because of depend on size of disk look can take long
 time.
 
 so:
 --- ffs_snapshot.c.orig 2011-12-09 06:45:11.000000000 +0000
 +++ ffs_snapshot.c      2011-12-09 06:49:43.000000000 +0000
 @@ -305,7 +305,7 @@
         ip->i_flag |= IN_CHANGE | IN_UPDATE;
         error = readblock(vp, bp, numblks - 1);
         bawrite(bp);
 -       if (error != 0)
 +       if (error != 0)    // why not just  if( error ) ???
                 goto out;
         /*
          * Preallocate critical data structures so that we can copy
 @@ -324,6 +324,10 @@
                 if (error)
                         goto out;
                 bawrite(ibp);
 +               if (blkno % 10 == 0)
 +                   ffs_syncvnode(vp, MNT_WAIT);
 +               if (error)           // to be same as line 385
 +                       goto out;
         }
         /*
          * Allocate copies for the superblock and its summary information.
 @@ -341,6 +345,10 @@
                 if (error)
                         goto out;
                 bawrite(nbp);
 +               if (loc % 10 == 0)
 +                   ffs_syncvnode(vp, MNT_WAIT);
 +               if (error)            //to be same as line 385
 +                       goto out;
         }
         /*
          * Allocate all cylinder group blocks.
 @@ -353,6 +361,8 @@
                 bawrite(nbp);
                 if (cg % 10 == 0)
                         ffs_syncvnode(vp, MNT_WAIT);
 +               if (error)           //to be same as line 385
 +                       goto out;.
         }
         /*
          * Copy all the cylinder group maps. Although the
 
 but I not shure. Please confirm
 
 
 -- 
 Ñ óâàæåíèåì,
  Êîíüêîâ                          mailto:kes-kes at yandex.ru
 


More information about the freebsd-fs mailing list