pNFS/flexfiles: Fix an Oopsable typo in ff_mirror_match_fh()
authorTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 30 Dec 2015 15:57:01 +0000 (10:57 -0500)
committerTrond Myklebust <trond.myklebust@primarydata.com>
Wed, 30 Dec 2015 15:57:01 +0000 (10:57 -0500)
Jeff reports seeing an Oops in ff_layout_alloc_lseg. Turns out
copy+paste has played cruel tricks on a nested loop.

Reported-by: Jeff Layton <jeff.layton@primarydata.com>
Cc: stable@vger.kernel.org # 4.3+
Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
fs/nfs/flexfilelayout/flexfilelayout.c

index 03516c80855a02b7513370e8f5b21d420f3327d7..405f46ba490e50df3635f125fb24a40e5b984899 100644 (file)
@@ -145,7 +145,7 @@ static bool ff_mirror_match_fh(const struct nfs4_ff_layout_mirror *m1,
                return false;
        for (i = 0; i < m1->fh_versions_cnt; i++) {
                bool found_fh = false;
-               for (j = 0; j < m2->fh_versions_cnt; i++) {
+               for (j = 0; j < m2->fh_versions_cnt; j++) {
                        if (nfs_compare_fh(&m1->fh_versions[i],
                                        &m2->fh_versions[j]) == 0) {
                                found_fh = true;