Skip to contentSkip to conversation

dnotify fix for readv/writev (Linux 2.4.20)

PATCH In review Zou Pengcheng 2 participants 2 messages Dec 2, 2002

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dnotify fix for readv/writev (Linux 2.4.20)

hi, Marcelo,

this is a patch to fix the dnotify bug of readv/writev.

Orignally DN_MODIFY is issued on readv while DN_ACCESS is issued on writev, which is obviously wrong. This patch fixes such problem.

cheers,
-- Pengcheng Zou

read_write.c Mon Dec 2 09:08:26 2002 renamed from read_write.c.orig Mon Dec 2 09:07:34 2002 +1 -1
diff -uNr fs/read_write.c.orig fs/read_write.c
@@ -315,7 +315,7 @@
        /* VERIFY_WRITE actually means a read, as we write to user space */
        if ((ret + (type == VERIFY_WRITE)) > 0)
                dnotify_parent(file->f_dentry,
-                       (type == VERIFY_WRITE) ? DN_MODIFY : DN_ACCESS);
+                       (type == VERIFY_WRITE) ? DN_ACCESS : DN_MODIFY);
        return ret;
 }
 
#1 lore raw

Hi Linus,

Quoted 8 lines · On Mon, 2 Dec 2002 09:22:43 +0800 Zou Pengcheng <[email protected]> wrote:

this is a patch to fix the dnotify bug of readv/writev.

Orignally DN_MODIFY is issued on readv while DN_ACCESS is issued on writev, which is obviously wrong. This patch fixes such problem.

cheers,
-- Pengcheng Zou

This is the equivalent patch for 2.5.50+.

Please apply.

Signature · 15 lines
Cheers,
Stephen Rothwell                    [email protected]
http://www.canb.auug.org.au/~sfr/

diff -ruN 2.5.50-BK/fs/read_write.c 2.5.50-BK-dnotify/fs/read_write.c
--- 2.5.50-BK/fs/read_write.c	2002-12-02 16:25:50.000000000 +1100
+++ 2.5.50-BK-dnotify/fs/read_write.c	2002-12-02 16:28:39.000000000 +1100
@@ -447,7 +447,7 @@
 		kfree(iov);
 	if ((ret + (type == READ)) > 0)
 		dnotify_parent(file->f_dentry,
-				(type == READ) ? DN_MODIFY : DN_ACCESS);
+				(type == READ) ? DN_ACCESS : DN_MODIFY);
 	return ret;
 }