Skip to contentSkip to conversation

ufs: rm hang up the kernel

PATCH New Evgeniy Dushistov 1 participant 1 message Jan 17, 2006 VFS

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 ufs: rm hang up the kernel

This patch fix the code like this:
bh = sb_find_get_block (sb, tmp + j);

if ((bh && DATA_BUFFER_USED(bh)) || tmp != fs32_to_cpu(sb, *p)) {
	retry = 1;
	brelse (bh);
	goto next1;
}

bforget (bh);

sb_find_get_block ordinary return buffer_head with b_count>=2, and this code assume that in case if "b_count>1" buffer is used, so this caused infinite loop.

---

fs/ufs/inode.c +1 -1
diff -uprN -X linux-2.6.15-git11-vanilla/Documentation/dontdiff linux-2.6.15-git11-vanilla/fs/ufs/inode.c linux-2.6.15-git11/fs/ufs/inode.c
@@ -376,7 +376,7 @@ out:
  * This function gets the block which contains the fragment.
  */
 
-static int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create)
+int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create)
 {
 	struct super_block * sb = inode->i_sb;
 	struct ufs_sb_private_info * uspi = UFS_SB(sb)->s_uspi;
fs/ufs/truncate.c +19 -59

159 lines not on this page · raw message

include/linux/ufs_fs.h +1 -0
diff -uprN -X linux-2.6.15-git11-vanilla/Documentation/dontdiff linux-2.6.15-git11-vanilla/include/linux/ufs_fs.h linux-2.6.15-git11/include/linux/ufs_fs.h
@@ -912,6 +912,7 @@ extern int ufs_sync_inode (struct inode 
 extern void ufs_delete_inode (struct inode *);
 extern struct buffer_head * ufs_getfrag (struct inode *, unsigned, int, int *);
 extern struct buffer_head * ufs_bread (struct inode *, unsigned, int, int *);
+extern int ufs_getfrag_block (struct inode *inode, sector_t fragment, struct buffer_head *bh_result, int create);
 
 /* namei.c */
 extern struct file_operations ufs_dir_operations;
Signature · 1 line
/Evgeniy