* our outstanding extent for clearing delalloc for this
                         * range.
                         */
-                       extent_clear_unlock_delalloc(inode, start, end, NULL,
+                       extent_clear_unlock_delalloc(inode, start, end,
+                                    locked_page,
                                     EXTENT_LOCKED | EXTENT_DELALLOC |
                                     EXTENT_DELALLOC_NEW | EXTENT_DEFRAG |
                                     EXTENT_DO_ACCOUNTING, PAGE_UNLOCK |
                        *nr_written = *nr_written +
                             (end - start + PAGE_SIZE) / PAGE_SIZE;
                        *page_started = 1;
+                       /*
+                        * locked_page is locked by the caller of
+                        * writepage_delalloc(), not locked by
+                        * __process_pages_contig().
+                        *
+                        * We can't let __process_pages_contig() to unlock it,
+                        * as it doesn't have any subpage::writers recorded.
+                        *
+                        * Here we manually unlock the page, since the caller
+                        * can't use page_started to determine if it's an
+                        * inline extent or a compressed extent.
+                        */
+                       unlock_page(locked_page);
                        goto out;
                } else if (ret < 0) {
                        goto out_unlock;