Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333131
b: refs/heads/master
c: 25c7533
h: refs/heads/master
i:
  333129: d489e07
  333127: 5636c67
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Sep 28, 2012
1 parent 3e0820f commit 7cc849d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b9e028fd89d6834558aa2a5bb30e5cff5c6c1059
refs/heads/master: 25c7533357a4c4a9311d40cc92e9648c8a7e763e
15 changes: 14 additions & 1 deletion trunk/fs/nfs/pnfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include "iostat.h"

#define NFSDBG_FACILITY NFSDBG_PNFS
#define PNFS_LAYOUTGET_RETRY_TIMEOUT (120*HZ)

/* Locking:
*
Expand Down Expand Up @@ -248,6 +249,7 @@ pnfs_iomode_to_fail_bit(u32 iomode)
static void
pnfs_layout_io_set_failed(struct pnfs_layout_hdr *lo, u32 iomode)
{
lo->plh_retry_timestamp = jiffies;
set_bit(pnfs_iomode_to_fail_bit(iomode), &lo->plh_flags);
dprintk("%s Setting layout IOMODE_%s fail bit\n", __func__,
iomode == IOMODE_RW ? "RW" : "READ");
Expand All @@ -256,7 +258,18 @@ pnfs_layout_io_set_failed(struct pnfs_layout_hdr *lo, u32 iomode)
static bool
pnfs_layout_io_test_failed(struct pnfs_layout_hdr *lo, u32 iomode)
{
return test_bit(pnfs_iomode_to_fail_bit(iomode), &lo->plh_flags) != 0;
unsigned long start, end;
if (test_bit(pnfs_iomode_to_fail_bit(iomode), &lo->plh_flags) == 0)
return false;
end = jiffies;
start = end - PNFS_LAYOUTGET_RETRY_TIMEOUT;
if (!time_in_range(lo->plh_retry_timestamp, start, end)) {
/* It is time to retry the failed layoutgets */
clear_bit(NFS_LAYOUT_RW_FAILED, &lo->plh_flags);
clear_bit(NFS_LAYOUT_RO_FAILED, &lo->plh_flags);
return false;
}
return true;
}

static void
Expand Down
1 change: 1 addition & 0 deletions trunk/fs/nfs/pnfs.h
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ struct pnfs_layout_hdr {
atomic_t plh_outstanding; /* number of RPCs out */
unsigned long plh_block_lgets; /* block LAYOUTGET if >0 */
u32 plh_barrier; /* ignore lower seqids */
unsigned long plh_retry_timestamp;
unsigned long plh_flags;
loff_t plh_lwb; /* last write byte for layoutcommit */
struct rpc_cred *plh_lc_cred; /* layoutcommit cred */
Expand Down

0 comments on commit 7cc849d

Please sign in to comment.