Whamcloud - gitweb
Merge b_md into HEAD
[fs/lustre-release.git] / lustre / extN / ext3-unmount_sync.diff
1 From adilger@clusterfs.com Mon Dec  2 10:26:44 2002
2 Date: Mon, 2 Dec 2002 10:26:44 -0700
3 From: Andreas Dilger <adilger@clusterfs.com>
4 To: Lustre LLNL Mailing list <lc-lustre@llnl.gov>,
5         Lustre Development Mailing List <lustre-devel@lists.sourceforge.net>
6 Subject: Re: data corrupting bug in 2.4.20 ext3, data=journal
7 Message-ID: <20021202102644.H1422@schatzie.adilger.int>
8 Mail-Followup-To: Lustre LLNL Mailing list <lc-lustre@llnl.gov>,
9         Lustre Development Mailing List <lustre-devel@lists.sourceforge.net>
10 Mime-Version: 1.0
11 Content-Type: text/plain; charset=us-ascii
12 Content-Disposition: inline
13 User-Agent: Mutt/1.2.5.1i
14 X-GPG-Key: 1024D/0D35BED6
15 X-GPG-Fingerprint: 7A37 5D79 BF1B CECA D44F  8A29 A488 39F5 0D35 BED6
16 Status: RO
17 Content-Length: 1160
18 Lines: 39
19
20 Here is the new-improved fix for the ext3 discarding data at umount bug
21 discovered late last week.  To be used instead of the previous ext3 fix.
22
23 Sadly, this is completely unrelated to the problems Mike is having with
24 ext3 under UML, since it is an unmount-time problem.
25
26 ----- Forwarded message from "Stephen C. Tweedie" <sct@redhat.com> -----
27 The attached patch seems to fix things for me.
28
29 Cheers,
30  Stephen
31
32
33 --- linux-2.4-ext3merge/fs/ext3/super.c.=K0027=.orig    2002-12-02 15:35:13.000000000 +0000
34 +++ linux-2.4-ext3merge/fs/ext3/super.c 2002-12-02 15:35:14.000000000 +0000
35 @@ -1640,7 +1640,12 @@
36         sb->s_dirt = 0;
37         target = log_start_commit(EXT3_SB(sb)->s_journal, NULL);
38  
39 -       if (do_sync_supers) {
40 +       /*
41 +        * Tricky --- if we are unmounting, the write really does need
42 +        * to be synchronous.  We can detect that by looking for NULL in
43 +        * sb->s_root.
44 +        */
45 +       if (do_sync_supers || !sb->s_root) {
46                 unlock_super(sb);
47                 log_wait_commit(EXT3_SB(sb)->s_journal, target);
48                 lock_super(sb);
49
50
51 ----- End forwarded message -----
52
53 Cheers, Andreas
54 --
55 Andreas Dilger
56 http://sourceforge.net/projects/ext2resize/
57 http://www-mddsp.enel.ucalgary.ca/People/adilger/
58
59