goto out_iput;
        res->size = i_size_read(inode);
        res->change_attr = delegation->change_attr;
-       if (nfsi->npages != 0)
+       if (nfsi->nrequests != 0)
                res->change_attr++;
        res->ctime = inode->i_ctime;
        res->mtime = inode->i_mtime;
 
        if ((fattr->valid & NFS_ATTR_FATTR_PRESIZE)
                        && (fattr->valid & NFS_ATTR_FATTR_SIZE)
                        && i_size_read(inode) == nfs_size_to_loff_t(fattr->pre_size)
-                       && nfsi->npages == 0) {
+                       && nfsi->nrequests == 0) {
                i_size_write(inode, nfs_size_to_loff_t(fattr->size));
                ret |= NFS_INO_INVALID_ATTR;
        }
        if (fattr->valid & NFS_ATTR_FATTR_SIZE) {
                cur_size = i_size_read(inode);
                new_isize = nfs_size_to_loff_t(fattr->size);
-               if (cur_size != new_isize && nfsi->npages == 0)
+               if (cur_size != new_isize && nfsi->nrequests == 0)
                        invalid |= NFS_INO_INVALID_ATTR|NFS_INO_REVAL_PAGECACHE;
        }
 
                if (new_isize != cur_isize) {
                        /* Do we perhaps have any outstanding writes, or has
                         * the file grown beyond our last write? */
-                       if ((nfsi->npages == 0) || new_isize > cur_isize) {
+                       if ((nfsi->nrequests == 0) || new_isize > cur_isize) {
                                i_size_write(inode, new_isize);
                                invalid |= NFS_INO_INVALID_ATTR|NFS_INO_INVALID_DATA;
                                invalid &= ~NFS_INO_REVAL_PAGECACHE;
        INIT_LIST_HEAD(&nfsi->access_cache_entry_lru);
        INIT_LIST_HEAD(&nfsi->access_cache_inode_lru);
        INIT_LIST_HEAD(&nfsi->commit_info.list);
-       nfsi->npages = 0;
+       nfsi->nrequests = 0;
        nfsi->commit_info.ncommit = 0;
        atomic_set(&nfsi->commit_info.rpcs_out, 0);
        atomic_set(&nfsi->silly_count, 1);
 
 static inline void
 nfs_page_group_init(struct nfs_page *req, struct nfs_page *prev)
 {
+       struct inode *inode;
        WARN_ON_ONCE(prev == req);
 
        if (!prev) {
                 * nfs_page_group_destroy is called */
                kref_get(&req->wb_head->wb_kref);
 
-               /* grab extra ref if head request has extra ref from
-                * the write/commit path to handle handoff between write
-                * and commit lists */
+               /* grab extra ref and bump the request count if head request
+                * has extra ref from the write/commit path to handle handoff
+                * between write and commit lists. */
                if (test_bit(PG_INODE_REF, &prev->wb_head->wb_flags)) {
+                       inode = page_file_mapping(req->wb_page)->host;
                        set_bit(PG_INODE_REF, &req->wb_flags);
                        kref_get(&req->wb_kref);
+                       spin_lock(&inode->i_lock);
+                       NFS_I(inode)->nrequests++;
+                       spin_unlock(&inode->i_lock);
                }
        }
 }
 
        nfs_lock_request(req);
 
        spin_lock(&inode->i_lock);
-       if (!nfsi->npages && NFS_PROTO(inode)->have_delegation(inode, FMODE_WRITE))
+       if (!nfsi->nrequests &&
+           NFS_PROTO(inode)->have_delegation(inode, FMODE_WRITE))
                inode->i_version++;
        /*
         * Swap-space should not get truncated. Hence no need to plug the race
                SetPagePrivate(req->wb_page);
                set_page_private(req->wb_page, (unsigned long)req);
        }
-       nfsi->npages++;
+       nfsi->nrequests++;
        /* this a head request for a page group - mark it as having an
-        * extra reference so sub groups can follow suit */
+        * extra reference so sub groups can follow suit.
+        * This flag also informs pgio layer when to bump nrequests when
+        * adding subrequests. */
        WARN_ON(test_and_set_bit(PG_INODE_REF, &req->wb_flags));
        kref_get(&req->wb_kref);
        spin_unlock(&inode->i_lock);
                        wake_up_page(head->wb_page, PG_private);
                        clear_bit(PG_MAPPED, &head->wb_flags);
                }
-               nfsi->npages--;
+               nfsi->nrequests--;
+               spin_unlock(&inode->i_lock);
+       } else {
+               spin_lock(&inode->i_lock);
+               nfsi->nrequests--;
                spin_unlock(&inode->i_lock);
        }
 
                /* Don't commit yet if this is a non-blocking flush and there
                 * are a lot of outstanding writes for this mapping.
                 */
-               if (nfsi->commit_info.ncommit <= (nfsi->npages >> 1))
+               if (nfsi->commit_info.ncommit <= (nfsi->nrequests >> 1))
                        goto out_mark_dirty;
 
                /* don't wait for the COMMIT response */
 
         */
        __be32                  cookieverf[2];
 
-       unsigned long           npages;
+       unsigned long           nrequests;
        struct nfs_mds_commit_info commit_info;
 
        /* Open contexts for shared mmap writes */
 static inline int
 nfs_have_writebacks(struct inode *inode)
 {
-       return NFS_I(inode)->npages != 0;
+       return NFS_I(inode)->nrequests != 0;
 }
 
 /*