diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c index bea662bd0ca6b921b15c1bda0aab950a2fec2c78..378aadf5e6db6bc3c9a92fd2e8d9561af382328a 100644 --- a/fs/ext4/inline.c +++ b/fs/ext4/inline.c @@ -594,6 +594,7 @@ static int ext4_convert_inline_data_to_extent(struct address_space *mapping, if (ret) { unlock_page(page); page_cache_release(page); + page = NULL; ext4_orphan_add(handle, inode); up_write(&EXT4_I(inode)->xattr_sem); sem_held = 0; @@ -613,7 +614,8 @@ static int ext4_convert_inline_data_to_extent(struct address_space *mapping, if (ret == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries)) goto retry; - block_commit_write(page, from, to); + if (page) + block_commit_write(page, from, to); out: if (page) { unlock_page(page);