diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index ceba60661d81..65176242886a 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c @@ -3480,6 +3480,9 @@ retry: * but cannot extend i_size. Bail out and pretend * the write failed... */ ret = PTR_ERR(handle); + if (inode->i_nlink) + ext4_orphan_del(NULL, inode); + goto out; } if (inode->i_nlink)