[PATCH] zero out i_blocks in get_pipe_inode

From: Martin J. Bligh
Date: Tue Nov 11 2003 - 17:41:13 EST


Fished from the 2.4 SuSE tree, which I'm trawling through.
This seems like a perfectly reasonable thing to do to me,
there was some discussion earlier on IRC. Some extracts from
the conversation were "returning random old data from the kernel
is always a bug", "any userland code that trips on that one is
broken", and "iirc it broke postfix". Nobody seemed to think it
was actively evil, and it seems to fix a bug ;-)

diff -purN -X /home/mbligh/.diff.exclude virgin/fs/pipe.c pipe_init/fs/pipe.c
--- virgin/fs/pipe.c 2003-10-14 15:50:30.000000000 -0700
+++ pipe_init/fs/pipe.c 2003-11-11 12:13:32.000000000 -0800
@@ -527,6 +527,7 @@ static struct inode * get_pipe_inode(voi
inode->i_gid = current->fsgid;
inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
inode->i_blksize = PAGE_SIZE;
+ inode->i_blocks = 0;
return inode;

fail_iput:

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/