linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 2.4.22-rc1 FIFO bug still present
@ 2003-08-06 17:23 Rob van Nieuwkerk
  2003-08-08 12:39 ` Alan Cox
  0 siblings, 1 reply; 6+ messages in thread
From: Rob van Nieuwkerk @ 2003-08-06 17:23 UTC (permalink / raw)
  To: linux-kernel, Marcelo Tosatti
  Cc: Rob van Nieuwkerk, Alan Cox, Stephen C. Tweedie

Hi Marcelo,

FYI:
I see that the "FIFO inode time-stamps are updated on a *readonly* fs"
bug is still not fixed in 2.4.22-rc1.

(this bug is a efficient way to destroy your CompactFlash devices in
certain applications ..)

Stephen C. Tweedie made a fix (see below) for it in May.
It has been in the Alan's -ac series since then and it works fine.

for more info see:

	http://www.ussg.iu.edu/hypermail/linux/kernel/0305.3/1132.html
	http://www.ussg.iu.edu/hypermail/linux/kernel/0305.3/1604.html

	greetings,
	Rob van Nieuwkerk

The patch:
(http://www.ussg.iu.edu/hypermail/linux/kernel/0305.3/att-1604/01-4202-vfs-mctime-rofs.patch):
###################################################################

--- 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);


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 2.4.22-rc1 FIFO bug still present
  2003-08-06 17:23 2.4.22-rc1 FIFO bug still present Rob van Nieuwkerk
@ 2003-08-08 12:39 ` Alan Cox
  2003-08-08 12:54   ` Rob van Nieuwkerk
  2003-08-08 14:46   ` Marcelo Tosatti
  0 siblings, 2 replies; 6+ messages in thread
From: Alan Cox @ 2003-08-08 12:39 UTC (permalink / raw)
  To: Rob van Nieuwkerk
  Cc: Linux Kernel Mailing List, Marcelo Tosatti, Stephen C. Tweedie

On Mer, 2003-08-06 at 18:23, Rob van Nieuwkerk wrote:
> Stephen C. Tweedie made a fix (see below) for it in May.
> It has been in the Alan's -ac series since then and it works fine.

Certainly seems to be fine and it is a real bug. There is another unfixed
one of the same form with tty drivers too


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 2.4.22-rc1 FIFO bug still present
  2003-08-08 12:39 ` Alan Cox
@ 2003-08-08 12:54   ` Rob van Nieuwkerk
  2003-08-08 17:23     ` Alan Cox
  2003-08-08 14:46   ` Marcelo Tosatti
  1 sibling, 1 reply; 6+ messages in thread
From: Rob van Nieuwkerk @ 2003-08-08 12:54 UTC (permalink / raw)
  To: Alan Cox; +Cc: Rob van Nieuwkerk, linux-kernel, marcelo, sct

On 08 Aug 2003 13:39:44 +0100
Alan Cox <alan@lxorguk.ukuu.org.uk> wrote:

> On Mer, 2003-08-06 at 18:23, Rob van Nieuwkerk wrote:
> > Stephen C. Tweedie made a fix (see below) for it in May.
> > It has been in the Alan's -ac series since then and it works fine.
> 
> Certainly seems to be fine and it is a real bug. There is another unfixed
> one of the same form with tty drivers too

Hi Alan,

How does this other bug present itself ?
I use both console and serial port output in my readonly CF
application.  And I don't have any writes to the CF anymore after
fixing the FIFO bug.

	greetings,
	Rob van Nieuwkerk

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 2.4.22-rc1 FIFO bug still present
  2003-08-08 12:39 ` Alan Cox
  2003-08-08 12:54   ` Rob van Nieuwkerk
@ 2003-08-08 14:46   ` Marcelo Tosatti
  1 sibling, 0 replies; 6+ messages in thread
From: Marcelo Tosatti @ 2003-08-08 14:46 UTC (permalink / raw)
  To: Alan Cox; +Cc: Rob van Nieuwkerk, Linux Kernel Mailing List, Stephen C. Tweedie



On 8 Aug 2003, Alan Cox wrote:

> On Mer, 2003-08-06 at 18:23, Rob van Nieuwkerk wrote:
> > Stephen C. Tweedie made a fix (see below) for it in May.
> > It has been in the Alan's -ac series since then and it works fine.
> 
> Certainly seems to be fine and it is a real bug. There is another unfixed
> one of the same form with tty drivers too

Applied. 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 2.4.22-rc1 FIFO bug still present
  2003-08-08 12:54   ` Rob van Nieuwkerk
@ 2003-08-08 17:23     ` Alan Cox
  0 siblings, 0 replies; 6+ messages in thread
From: Alan Cox @ 2003-08-08 17:23 UTC (permalink / raw)
  To: Rob van Nieuwkerk; +Cc: Linux Kernel Mailing List, Marcelo Tosatti, sct

On Gwe, 2003-08-08 at 13:54, Rob van Nieuwkerk wrote:
> How does this other bug present itself ?
> I use both console and serial port output in my readonly CF
> application.  And I don't have any writes to the CF anymore after
> fixing the FIFO bug.

create a tty device node
open it
delete it
mount the fs r/o or unmount it
close it




^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: 2.4.22-rc1 FIFO bug still present
@ 2003-08-07 16:51 Bartlomiej Zolnierkiewicz
  0 siblings, 0 replies; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2003-08-07 16:51 UTC (permalink / raw)
  To: Rob van Nieuwkerk; +Cc: Alan Cox, Stephen C. Tweedie, linux-kernel


Doh. It is not in 2.6-test too.

--bartlomiej


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2003-08-08 17:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-06 17:23 2.4.22-rc1 FIFO bug still present Rob van Nieuwkerk
2003-08-08 12:39 ` Alan Cox
2003-08-08 12:54   ` Rob van Nieuwkerk
2003-08-08 17:23     ` Alan Cox
2003-08-08 14:46   ` Marcelo Tosatti
2003-08-07 16:51 Bartlomiej Zolnierkiewicz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).