diff options
author | Jan Kara <jack@suse.cz> | 2009-07-13 16:22:22 -0400 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2009-07-13 16:22:22 -0400 |
commit | ffacfa7a79d6c00624196b2d13b0a7f72f2b8227 (patch) | |
tree | 201920b755aff4c8a196006c0ec5538235b7ee32 /block/blk-map.c | |
parent | f91d1d04171026e56c7e343ee3cdcc801dd85cfb (diff) | |
download | op-kernel-dev-ffacfa7a79d6c00624196b2d13b0a7f72f2b8227.zip op-kernel-dev-ffacfa7a79d6c00624196b2d13b0a7f72f2b8227.tar.gz |
ext4: Fix truncation of symlinks after failed write
Contents of long symlinks is written via standard write methods. So
when the write fails, we add inode to orphan list. But symlinks don't
have .truncate method defined so nobody properly removes them from the
on disk orphan list.
Fix this by calling ext4_truncate() directly instead of calling
vmtruncate() (which is saner anyway since we don't need anything
vmtruncate() does except from calling .truncate in these paths). We
also add inode to orphan list only if ext4_can_truncate() is true
(currently, it can be false for symlinks when there are no blocks
allocated) - otherwise orphan list processing will complain and
ext4_truncate() will not remove inode from on-disk orphan list.
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Diffstat (limited to 'block/blk-map.c')
0 files changed, 0 insertions, 0 deletions