set_page_writeback(page);
                end_page_writeback(page);
        }
-       /*
-        * Here we used to have a check for PageError() and then set @ret and
-        * call end_extent_writepage().
-        *
-        * But in fact setting @ret here will cause different error paths
-        * between subpage and regular sectorsize.
-        *
-        * For regular page size, we never submit current page, but only add
-        * current page to current bio.
-        * The bio submission can only happen in next page.
-        * Thus if we hit the PageError() branch, @ret is already set to
-        * non-zero value and will not get updated for regular sectorsize.
-        *
-        * But for subpage case, it's possible we submit part of current page,
-        * thus can get PageError() set by submitted bio of the same page,
-        * while our @ret is still 0.
-        *
-        * So here we unify the behavior and don't set @ret.
-        * Error can still be properly passed to higher layer as page will
-        * be set error, here we just don't handle the IO failure.
-        *
-        * NOTE: This is just a hotfix for subpage.
-        * The root fix will be properly ending ordered extent when we hit
-        * an error during writeback.
-        *
-        * But that needs a bigger refactoring, as we not only need to grab the
-        * submitted OE, but also need to know exactly at which bytenr we hit
-        * the error.
-        * Currently the full page based __extent_writepage_io() is not
-        * capable of that.
-        */
-       if (PageError(page))
+       if (ret)
                end_extent_writepage(page, ret, page_start, page_end);
        if (bio_ctrl->extent_locked) {
                struct writeback_control *wbc = bio_ctrl->wbc;