aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2004-11-19 14:39:14 -0500
committerTheodore Ts'o <tytso@mit.edu>2004-11-19 14:39:14 -0500
commit9c92d848a8125c554b469440fbe72bb0ad740456 (patch)
treed9f494c4a170cda6a2a7c47467a24b5c60746b9f
parent3a03c2ca5e0aa9fabe1ae7e635d1f91a3a9eaec2 (diff)
downloade2fsprogs-9c92d848a8125c554b469440fbe72bb0ad740456.tar.gz
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)
-rw-r--r--debugfs/ChangeLog7
-rw-r--r--debugfs/debugfs.c2
2 files changed, 9 insertions, 0 deletions
diff --git a/debugfs/ChangeLog b/debugfs/ChangeLog
index 34e16c18..315a4f0d 100644
--- a/debugfs/ChangeLog
+++ b/debugfs/ChangeLog
@@ -1,3 +1,10 @@
+2004-11-19 Theodore Ts'o <tytso@mit.edu>
+
+ * 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 <tytso@mit.edu>
* debugfs.c, debugfs.8.in: Add new option -d which allows the
diff --git a/debugfs/debugfs.c b/debugfs/debugfs.c
index 89b9d6c4..dab49d48 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);