diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-20 21:19:43 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-09-28 16:03:11 -0400 |
commit | 115ce575cb10918514d053ef15f597a4e6ff60e9 (patch) | |
tree | 8eef5b764740c41aaa41a628f24d0bced750b6e3 | |
parent | 3e6212149304eaf9289d5bc56e003068660f3476 (diff) | |
download | linux-115ce575cb10918514d053ef15f597a4e6ff60e9.tar.bz2 |
NFSv4.1: pnfs_layout_io_set_failed must clear invalid lsegs
If pnfs_layout_io_test_failed() authorises a retry of the failed layoutgets,
we should clear the existing layout segments so that we start afresh. Do
this in pnfs_layout_io_set_failed().
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
-rw-r--r-- | fs/nfs/pnfs.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/nfs/pnfs.c b/fs/nfs/pnfs.c index 6834fa1be571..9ee3bd705b94 100644 --- a/fs/nfs/pnfs.c +++ b/fs/nfs/pnfs.c @@ -265,10 +265,18 @@ static void pnfs_layout_io_set_failed(struct pnfs_layout_hdr *lo, u32 iomode) { struct inode *inode = lo->plh_inode; + struct pnfs_layout_range range = { + .iomode = iomode, + .offset = 0, + .length = NFS4_MAX_UINT64, + }; + LIST_HEAD(head); spin_lock(&inode->i_lock); pnfs_layout_set_fail_bit(lo, pnfs_iomode_to_fail_bit(iomode)); + pnfs_mark_matching_lsegs_invalid(lo, &head, &range); spin_unlock(&inode->i_lock); + pnfs_free_lseg_list(&head); dprintk("%s Setting layout IOMODE_%s fail bit\n", __func__, iomode == IOMODE_RW ? "RW" : "READ"); } |