]> git.neil.brown.name Git - history.git/commitdiff
[PATCH] 2.5.6 Fix RPC credentials when coalescing NFS reads/writes...
authorTrond Myklebust <trond.myklebust@fys.uio.no>
Tue, 12 Mar 2002 06:02:53 +0000 (22:02 -0800)
committerLinus Torvalds <torvalds@penguin.transmeta.com>
Tue, 12 Mar 2002 06:02:53 +0000 (22:02 -0800)
  The following fixes up a couple of bugs that resulted from the fix
in 2.5.4 for ETXTBSY: Since the READ requests now only store RPC
credentials and not the struct file, we need to be careful when
deciding to coalesce requests on different pages into 1 RPC call that
we compare the credentials instead of the struct file.

fs/nfs/pagelist.c
fs/nfs/write.c

index 129b277a0606e7941102c2c2f93ac05754551033..6daa14284ad649a89e5b6d922058f19fbc166a59 100644 (file)
@@ -231,7 +231,7 @@ nfs_wait_on_request(struct nfs_page *req)
  *
  * Moves a maximum of 'nmax' elements from one list to another.
  * The elements are checked to ensure that they form a contiguous set
- * of pages, and that they originated from the same file.
+ * of pages, and that the RPC credentials are the same.
  */
 int
 nfs_coalesce_requests(struct list_head *head, struct list_head *dst,
@@ -245,7 +245,7 @@ nfs_coalesce_requests(struct list_head *head, struct list_head *dst,
 
                req = nfs_list_entry(head->next);
                if (prev) {
-                       if (req->wb_file != prev->wb_file)
+                       if (req->wb_cred != prev->wb_cred)
                                break;
                        if (page_index(req->wb_page) != page_index(prev->wb_page)+1)
                                break;
@@ -272,14 +272,14 @@ nfs_coalesce_requests(struct list_head *head, struct list_head *dst,
  *
  * Tries to coalesce more requests by traversing the request's wb_list.
  * Moves the resulting list into dst. Requests are guaranteed to be
- * contiguous, and to originate from the same file.
+ * contiguous, and have the same RPC credentials.
  */
 static int
 nfs_scan_forward(struct nfs_page *req, struct list_head *dst, int nmax)
 {
        struct nfs_server *server = NFS_SERVER(req->wb_inode);
        struct list_head *pos, *head = req->wb_list_head;
-       struct file *file = req->wb_file;
+       struct rpc_cred *cred = req->wb_cred;
        unsigned long idx = page_index(req->wb_page) + 1;
        int npages = 0;
 
@@ -300,7 +300,7 @@ nfs_scan_forward(struct nfs_page *req, struct list_head *dst, int nmax)
                        break;
                if (req->wb_offset != 0)
                        break;
-               if (req->wb_file != file)
+               if (req->wb_cred != cred)
                        break;
        }
        return npages;
index c9be750403a79adf9170f21a26c096a26cca617c..c9ef1441c8465515c3c16fc3a69aef43a01ae080 100644 (file)
@@ -764,6 +764,7 @@ int
 nfs_flush_incompatible(struct file *file, struct page *page)
 {
        struct inode    *inode = page->mapping->host;
+       struct rpc_cred *cred = nfs_file_cred(file);
        struct nfs_page *req;
        int             status = 0;
        /*
@@ -776,7 +777,7 @@ nfs_flush_incompatible(struct file *file, struct page *page)
         */
        req = nfs_find_request(inode,page);
        if (req) {
-               if (req->wb_file != file || req->wb_page != page)
+               if (req->wb_file != file || req->wb_cred != cred || req->wb_page != page)
                        status = nfs_wb_page(inode, page);
                nfs_release_request(req);
        }