zero out i_blocks in get_pipe_inode
PATCH 1/1 zero out i_blocks in get_pipe_inode
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 ;-)
fs/pipe.c +1 -0
@@ -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:
Quoted 2 lines · Martin J. Bligh
+
inode->i_blocks= 0;
alloc_inode() already did that.
Quoted 5 lines · On Tue, 11 Nov 2003 14:48:42 -0800 Andrew Morton <[email protected]> wrote:
Quoted 2 lines · Martin J. Bligh
+
inode->i_blocks= 0;
alloc_inode()already did that.
It didn't in 2.4 I think. But it may be worth auditing if all fields are covered.
-Andi
Quoted 3 lines
Quoted 1 line
+
inode->i_blocks= 0;
alloc_inode()already did that.
Sigh ... yes, you're right - sorry.
get_pipe_inode -> new_inode -> alloc_inode. definitely covered.
I shall crawl back under my regularly scheduled stone ;-)
M.