mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Stephen C. Tweedie" <sct@redhat.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Rob van Nieuwkerk <robn@verdi.et.tudelft.nl>,
	root@chaos.analogic.com,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"Marcelo W. Tosatti" <marcelo@conectiva.com.br>,
	Stephen Tweedie <sct@redhat.com>
Subject: Re: 2.4 bug: fifo-write causes diskwrites to read-only fs !
Date: 30 May 2003 16:18:53 +0100	[thread overview]
Message-ID: <1054307933.3749.313.camel@sisko.scot.redhat.com> (raw)
In-Reply-To: <20030530155820.A11144@infradead.org>

[-- Attachment #1: Type: text/plain, Size: 287 bytes --]

Hi,

On Fri, 2003-05-30 at 15:58, Christoph Hellwig wrote:

> Yikes, this looks like devfs code!  Please try to use proper kernel style..

It's pure cut-and-paste from the update_atime immediately above it.  But
sure, we can clean them both up while we're at it if you want.

--Stephen


[-- Attachment #2: 4202-vfs-mctime-rofs.patch --]
[-- Type: text/plain, Size: 1936 bytes --]

--- linux-2.4-odirect/fs/inode.c.=K0001=.orig
+++ linux-2.4-odirect/fs/inode.c
@@ -1187,12 +1187,34 @@ void update_atime (struct inode *inode)
 {
 	if (inode->i_atime == CURRENT_TIME)
 		return;
-	if ( IS_NOATIME (inode) ) return;
-	if ( IS_NODIRATIME (inode) && S_ISDIR (inode->i_mode) ) return;
-	if ( IS_RDONLY (inode) ) return;
+	if (IS_NOATIME(inode))
+		return;
+	if (IS_NODIRATIME(inode) && S_ISDIR(inode->i_mode)) 
+		return;
+	if (IS_RDONLY(inode)) 
+		return;
 	inode->i_atime = CURRENT_TIME;
 	mark_inode_dirty_sync (inode);
-}   /*  End Function update_atime  */
+}
+
+/**
+ *	update_mctime	-	update the mtime and ctime
+ *	@inode: inode accessed
+ *
+ *	Update the modified and changed times on an inode for writes to special
+ *	files such as fifos.  No change is forced if the timestamps are already
+ *	up-to-date or if the filesystem is readonly.
+ */
+ 
+void update_mctime (struct inode *inode)
+{
+	if (inode->i_mtime == CURRENT_TIME && inode->i_ctime == CURRENT_TIME)
+		return;
+	if (IS_RDONLY(inode))
+		return;
+	inode->i_ctime = inode->i_mtime = CURRENT_TIME;
+	mark_inode_dirty (inode);
+}
 
 
 /*
--- linux-2.4-odirect/fs/pipe.c.=K0001=.orig
+++ linux-2.4-odirect/fs/pipe.c
@@ -230,8 +230,7 @@ pipe_write(struct file *filp, const char
 	/* Signal readers asynchronously that there is more data.  */
 	wake_up_interruptible(PIPE_WAIT(*inode));
 
-	inode->i_ctime = inode->i_mtime = CURRENT_TIME;
-	mark_inode_dirty(inode);
+	update_mctime(inode);
 
 out:
 	up(PIPE_SEM(*inode));
--- linux-2.4-odirect/include/linux/fs.h.=K0001=.orig
+++ linux-2.4-odirect/include/linux/fs.h
@@ -201,6 +201,7 @@ extern int leases_enable, dir_notify_ena
 #include <asm/byteorder.h>
 
 extern void update_atime (struct inode *);
+extern void update_mctime (struct inode *);
 #define UPDATE_ATIME(inode) update_atime (inode)
 
 extern void buffer_init(unsigned long);

  reply	other threads:[~2003-05-30 15:05 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-28 17:58 Rob van Nieuwkerk
2003-05-28 18:52 ` Rob van Nieuwkerk
2003-05-28 19:17   ` Richard B. Johnson
2003-05-28 19:34     ` Rob van Nieuwkerk
2003-05-28 20:22       ` Richard B. Johnson
2003-05-28 20:52         ` Rob van Nieuwkerk
2003-05-30 13:21           ` Stephen C. Tweedie
2003-05-30 14:58             ` Christoph Hellwig
2003-05-30 15:18               ` Stephen C. Tweedie [this message]
2003-05-30 16:36                 ` Andrew Morton
2003-05-28 19:22 ` Nuno Silva
2003-05-28 19:37   ` Rob van Nieuwkerk

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=1054307933.3749.313.camel@sisko.scot.redhat.com \
    --to=sct@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marcelo@conectiva.com.br \
    --cc=robn@verdi.et.tudelft.nl \
    --cc=root@chaos.analogic.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®