linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH]: reiserfs: D-clear-i_blocks.patch
@ 2001-08-02 15:45 Nikita Danilov
  2001-08-02 17:26 ` Andreas Dilger
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Nikita Danilov @ 2001-08-02 15:45 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Reiserfs developers mail-list, linux-kernel

Hello, Linus,

This patch sets inode.i_blocks to zero on deletion of reiserfs
file. This in particular cures hard to believe bug when saving file in
EMACS caused top to loose sight of all processes:
 . reiserfs didn't properly cleared i_blocks when removing
   symlinks. Actually -7 was inserted into unsigned i_blocks field. This
   didn't usually hurt because file is being deleted;
 . inode is reused for procfs and neither get_new_inode() nor
   proc_read_inode() cleared i_blocks;
 . now procfs inode has huge i_blocks field;
 . top calls stat on it and libc wrapper returns EOVERFLOW, as i_blocks
   doesn't fit into user-level struct.
 . top sees nothing.
  
[lkml: please CC me, I am not subscribed.]

Nikita.
diff -rup linux-2.4.8-pre3/fs/reiserfs/inode.c linux-2.4.8-pre3.patched/fs/reiserfs/inode.c
--- linux-2.4.8-pre3/fs/reiserfs/inode.c	Wed Aug  1 17:21:10 2001
+++ linux-2.4.8-pre3.patched/fs/reiserfs/inode.c	Wed Aug  1 21:33:37 2001
@@ -55,6 +55,7 @@ void reiserfs_delete_inode (struct inode
 	;
     }
     clear_inode (inode); /* note this must go after the journal_end to prevent deadlock */
+    inode->i_blocks = 0;
     unlock_kernel() ;
 }
 

^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH]: reiserfs: D-clear-i_blocks.patch
@ 2001-08-30 14:27 Nikita Danilov
  0 siblings, 0 replies; 8+ messages in thread
From: Nikita Danilov @ 2001-08-30 14:27 UTC (permalink / raw)
  To: Linus Torvalds
  Cc: Reiserfs developers mail-list, Linux kernel developer's mailing list

Hello, Linus,

    This patch sets inode.i_blocks to zero on deletion of reiserfs
    file. This in particular cures hard to believe bug when saving file in
    EMACS caused top to loose sight of all processes:
     . reiserfs didn't properly cleared i_blocks when removing
       symlinks. Actually -7 was inserted into unsigned i_blocks field. This
       didn't usually hurt because file is being deleted;
     . inode is reused for procfs and neither get_new_inode() nor
       proc_read_inode() cleared i_blocks;
     . now procfs inode has huge i_blocks field;
     . top calls stat on it and libc wrapper returns EOVERFLOW, as i_blocks
       doesn't fit into user-level struct.
     . top sees nothing.
   Alexander Viro and other people proposed that in stead i_blocks
   should be cleared in generic VFS code. This patch is minimal
   change required to correct bug.

This patch is against 2.4.10-pre2.
Please apply.

Nikita.
diff -rup linux/fs/reiserfs/inode.c linux.patched/fs/reiserfs/inode.c
--- linux/fs/reiserfs/inode.c	Wed Aug  1 17:21:10 2001
+++ linux.patched/fs/reiserfs/inode.c	Wed Aug  1 21:33:37 2001
@@ -55,6 +55,7 @@ void reiserfs_delete_inode (struct inode
 	;
     }
     clear_inode (inode); /* note this must go after the journal_end to prevent deadlock */
+    inode->i_blocks = 0;
     unlock_kernel() ;
 }
 

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

end of thread, other threads:[~2001-08-30 14:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-02 15:45 [PATCH]: reiserfs: D-clear-i_blocks.patch Nikita Danilov
2001-08-02 17:26 ` Andreas Dilger
2001-08-02 17:45 ` Alexander Viro
2001-08-02 19:21   ` [reiserfs-dev] " Hans Reiser
2001-08-02 18:31 ` Nikita Danilov
2001-08-03 12:53   ` jlnance
2001-08-03 16:16   ` Nikita Danilov
2001-08-30 14:27 Nikita Danilov

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