]> err.no Git - linux-2.6/blobdiff - fs/nfs/write.c
Merge branch 'net-2.6.26-isatap-20080403' of git://git.linux-ipv6.org/gitroot/yoshfuj...
[linux-2.6] / fs / nfs / write.c
index f55c437124a2287e1ae80834af5059c0f3388d38..bed63416a55b3c51ab539666c4f3f5f5ca8321b0 100644 (file)
@@ -39,6 +39,7 @@ static struct nfs_page * nfs_update_request(struct nfs_open_context*,
                                            unsigned int, unsigned int);
 static void nfs_pageio_init_write(struct nfs_pageio_descriptor *desc,
                                  struct inode *inode, int ioflags);
+static void nfs_redirty_request(struct nfs_page *req);
 static const struct rpc_call_ops nfs_write_partial_ops;
 static const struct rpc_call_ops nfs_write_full_ops;
 static const struct rpc_call_ops nfs_commit_ops;
@@ -288,7 +289,12 @@ static int nfs_page_async_flush(struct nfs_pageio_descriptor *pgio,
                BUG();
        }
        spin_unlock(&inode->i_lock);
-       nfs_pageio_add_request(pgio, req);
+       if (!nfs_pageio_add_request(pgio, req)) {
+               nfs_redirty_request(req);
+               nfs_end_page_writeback(page);
+               nfs_clear_page_tag_locked(req);
+               return pgio->pg_error;
+       }
        return 0;
 }
 
@@ -734,7 +740,7 @@ int nfs_updatepage(struct file *file, struct page *page,
         */
        if (nfs_write_pageuptodate(page, inode) &&
                        inode->i_flock == NULL &&
-                       !(file->f_mode & O_SYNC)) {
+                       !(file->f_flags & O_SYNC)) {
                count = max(count + offset, nfs_page_length(page));
                offset = 0;
        }