mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-12-01 08:59:33 +00:00
fs: ext4: fix files seen as symlink during deletion
The deletion process handles special case for symlinks whose target are small enough that it fits in struct ext2_inode.b.symlink. So no block had been allocated. But the check of file type wrongly considered regular files as symlink. So, no block was freed. So, the EXT4 partition could be corrupted because of no free block available. Signed-off-by: Corentin GUILLEVIC <corentin.guillevic@smile.fr>
This commit is contained in:
parent
fefd949157
commit
39409fac2c
1 changed files with 1 additions and 1 deletions
|
@ -473,7 +473,7 @@ static int ext4fs_delete_file(int inodeno)
|
||||||
* special case for symlinks whose target are small enough that
|
* special case for symlinks whose target are small enough that
|
||||||
*it fits in struct ext2_inode.b.symlink: no block had been allocated
|
*it fits in struct ext2_inode.b.symlink: no block had been allocated
|
||||||
*/
|
*/
|
||||||
if ((le16_to_cpu(inode.mode) & S_IFLNK) &&
|
if (S_ISLNK(le16_to_cpu(inode.mode)) &&
|
||||||
le32_to_cpu(inode.size) <= sizeof(inode.b.symlink)) {
|
le32_to_cpu(inode.size) <= sizeof(inode.b.symlink)) {
|
||||||
no_blocks = 0;
|
no_blocks = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue