mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andreas Dilger <adilger@turbolinux.com>
To: torvalds@transmeta.com,
	Linux kernel development list <linux-kernel@vger.kernel.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>
Subject: [PATCH] move sync_supers to end of sync functions
Date: Wed, 1 Aug 2001 16:21:00 -0600 (MDT)	[thread overview]
Message-ID: <200108012221.f71ML0NH007455@webber.adilger.int> (raw)

Alan, Linus,
the following patch ensures that write_super() or sync_supers() is called
_after_ other filesystem I/O is completed.  The current order means that a
superblock could be dirtied by other filesystem I/O after the superblock
has been "synced".  This has been part of the ext3 patches for a long
time, but should really be done in the stock kernel sources as well.

Cheers, Andreas
========================================================================
diff -ru linux-2.4.7.orig/fs/buffer.c linux-2.4.7-aed/fs/buffer.c
--- linux-2.4.7.orig/fs/buffer.c	Tue Jul 31 15:00:37 2001
+++ linux-2.4.7-aed/fs/buffer.c	Tue Jul 31 16:45:09 2001
@@ -310,11 +312,11 @@
 
 	lock_kernel();
 	sync_inodes_sb(sb);
+	DQUOT_SYNC(dev);
 	lock_super(sb);
 	if (sb->s_dirt && sb->s_op && sb->s_op->write_super)
 		sb->s_op->write_super(sb);
 	unlock_super(sb);
-	DQUOT_SYNC(dev);
 	unlock_kernel();
 
 	return sync_buffers(dev, 1);
@@ -325,9 +327,9 @@
 	sync_buffers(dev, 0);
 
 	lock_kernel();
-	sync_supers(dev);
 	sync_inodes(dev);
 	DQUOT_SYNC(dev);
+	sync_supers(dev);
 	unlock_kernel();
 
 	return sync_buffers(dev, 1);
@@ -2608,8 +2693,8 @@
 static int sync_old_buffers(void)
 {
 	lock_kernel();
-	sync_supers(0);
 	sync_unlocked_inodes();
+	sync_supers(0);
 	unlock_kernel();
 
 	flush_dirty_buffers(1);
-- 
Andreas Dilger  \ "If a man ate a pound of pasta and a pound of antipasto,
                 \  would they cancel out, leaving him still hungry?"
http://www-mddsp.enel.ucalgary.ca/People/adilger/               -- Dogbert


                 reply	other threads:[~2001-08-01 22:22 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200108012221.f71ML0NH007455@webber.adilger.int \
    --to=adilger@turbolinux.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@transmeta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®