diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 9bcb7f2b86dd891f11bd1690824133b6ed81cd95..c7f77c643008558938ed0cf5d23698863d1ca931 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -5625,7 +5625,7 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr) up_write(&EXT4_I(inode)->i_data_sem); ext4_journal_stop(handle); if (error) { - if (orphan) + if (orphan && inode->i_nlink) ext4_orphan_del(NULL, inode); goto err_out; }