From: Theodore Ts'o Date: Fri, 19 Nov 2004 19:39:14 +0000 (-0500) Subject: debugfs.c (kill_file_by_inode): Only iterate over the inode to X-Git-Tag: E2FSPROGS-1_36~121 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=9c92d848a8125c554b469440fbe72bb0ad740456;p=tools%2Fe2fsprogs.git debugfs.c (kill_file_by_inode): Only iterate over the inode to release blocks if the inode has them; otherwise attempting to rm devices and fast symlinks will lead to errors. (Addresses Sourceforge Bug #954741 and #957244) --- diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog index 34e16c1..315a4f0 100644 --- a/debugfs/ChangeLog +++ b/debugfs/ChangeLog @@ -1,3 +1,10 @@ +2004-11-19 Theodore Ts'o + + * debugfs.c (kill_file_by_inode): Only iterate over the inode to + release blocks if the inode has them; otherwise attempting + to rm devices and fast symlinks will lead to errors. + (Addresses Sourceforge Bug #954741 and #957244) + 2004-07-28 Theodore Ts'o * debugfs.c, debugfs.8.in: Add new option -d which allows the diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c index 89b9d6c..dab49d4 100644 --- a/debugfs/debugfs.c +++ b/debugfs/debugfs.c @@ -1372,6 +1372,8 @@ static void kill_file_by_inode(ext2_ino_t inode) inode_buf.i_dtime = time(NULL); if (debugfs_write_inode(inode, &inode_buf, 0)) return; + if (!ext2fs_inode_has_valid_blocks(&inode_buf)) + return; ext2fs_block_iterate(current_fs, inode, 0, NULL, release_blocks_proc, NULL);