From: Trond Myklebust Date: Sun, 24 Jul 2016 21:08:59 +0000 (-0400) Subject: Merge branch 'pnfs' X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=668f455dac57050e33a43ff5fe006f6cd947fc65;p=openwrt%2Fstaging%2Fblogic.git Merge branch 'pnfs' --- 668f455dac57050e33a43ff5fe006f6cd947fc65 diff --cc fs/nfs/nfs4proc.c index a1a3b4c9a563,d38cc5f0282f..d30f88c667b7 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@@ -7940,25 -7921,28 +7940,24 @@@ nfs4_layoutget_handle_exception(struct exception->state = lgp->args.ctx->state; break; } - lo = NFS_I(inode)->layout; - if (lo && !test_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags) && - nfs4_stateid_match_other(&lgp->args.stateid, &lo->plh_stateid)) { - LIST_HEAD(head); - - /* - * Mark the bad layout state as invalid, then retry - * with the current stateid. - */ - pnfs_mark_layout_stateid_invalid(lo, &head); - spin_unlock(&inode->i_lock); - pnfs_free_lseg_list(&head); - status = -EAGAIN; - goto out; - } else - spin_unlock(&inode->i_lock); - } - status = nfs4_handle_exception(server, status, exception); - if (exception->retry) + /* + * Mark the bad layout state as invalid, then retry + */ - set_bit(NFS_LAYOUT_INVALID_STID, &lo->plh_flags); - pnfs_mark_matching_lsegs_invalid(lo, &head, NULL, 0); ++ pnfs_mark_layout_stateid_invalid(lo, &head); + spin_unlock(&inode->i_lock); + pnfs_free_lseg_list(&head); status = -EAGAIN; + goto out; + } + + err = nfs4_handle_exception(server, nfs4err, exception); + if (!status) { + if (exception->retry) + status = -EAGAIN; + else + status = err; + } out: dprintk("<-- %s\n", __func__); return status;