pNFS/flexfiles: Fix ff_layout_add_ds_error_locked()
authorTrond Myklebust <trond.myklebust@primarydata.com>
Tue, 6 Dec 2016 17:00:51 +0000 (12:00 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 7 Dec 2016 18:41:58 +0000 (13:41 -0500)
When we're merging an old entry into our new entry, we want to ensure that
we add the list entry in the correct place.

Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/flexfilelayout/flexfilelayoutdev.c

index eb98395c3651c0720506f2cc40f7986092438b7b..142bfd0b16635a37c5c292515b41d77d5c2911c2 100644 (file)
@@ -254,8 +254,9 @@ ff_layout_add_ds_error_locked(struct nfs4_flexfile_layout *flo,
                }
                /* Entries match, so merge "err" into "dserr" */
                extend_ds_error(dserr, err->offset, err->length);
-               list_del(&err->list);
+               list_replace(&err->list, &dserr->list);
                kfree(err);
+               return;
        }
 
        list_add_tail(&dserr->list, head);