aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSunil Mushran <sunil.mushran@oracle.com>2009-06-19 19:53:18 -0400
committerJoel Becker <joel.becker@oracle.com>2009-06-22 17:24:53 -0400
commit3211949f8998dde71d9fe2e063de045ece5e0473 (patch)
tree3aed155421642a6e04c94e0c5c521dea54e0b029
parent692684e19e317a374c18e70a44d6413e51f71c11 (diff)
ocfs2: Do not initialize lvb in ocfs2_orphan_scan_lock_res_init()
We don't access the LVB in our ocfs2_*_lock_res_init() functions. Since the LVB can become invalid during some cluster recovery operations, the dlmglue must be able to handle an uninitialized LVB. For the orphan scan lock, we initialized an uninitialzed LVB with our scan sequence number plus one. This starts a normal orphan scan cycle. Signed-off-by: Sunil Mushran <sunil.mushran@oracle.com> Signed-off-by: Joel Becker <joel.becker@oracle.com>
-rw-r--r--fs/ocfs2/dlmglue.c7
-rw-r--r--fs/ocfs2/journal.c1
2 files changed, 4 insertions, 4 deletions
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c
index 83d2ddb27186..d3d1f9372f7e 100644
--- a/fs/ocfs2/dlmglue.c
+++ b/fs/ocfs2/dlmglue.c
@@ -644,14 +644,10 @@ static void ocfs2_nfs_sync_lock_res_init(struct ocfs2_lock_res *res,
644static void ocfs2_orphan_scan_lock_res_init(struct ocfs2_lock_res *res, 644static void ocfs2_orphan_scan_lock_res_init(struct ocfs2_lock_res *res,
645 struct ocfs2_super *osb) 645 struct ocfs2_super *osb)
646{ 646{
647 struct ocfs2_orphan_scan_lvb *lvb;
648
649 ocfs2_lock_res_init_once(res); 647 ocfs2_lock_res_init_once(res);
650 ocfs2_build_lock_name(OCFS2_LOCK_TYPE_ORPHAN_SCAN, 0, 0, res->l_name); 648 ocfs2_build_lock_name(OCFS2_LOCK_TYPE_ORPHAN_SCAN, 0, 0, res->l_name);
651 ocfs2_lock_res_init_common(osb, res, OCFS2_LOCK_TYPE_ORPHAN_SCAN, 649 ocfs2_lock_res_init_common(osb, res, OCFS2_LOCK_TYPE_ORPHAN_SCAN,
652 &ocfs2_orphan_scan_lops, osb); 650 &ocfs2_orphan_scan_lops, osb);
653 lvb = ocfs2_dlm_lvb(&res->l_lksb);
654 lvb->lvb_version = OCFS2_ORPHAN_LVB_VERSION;
655} 651}
656 652
657void ocfs2_file_lock_res_init(struct ocfs2_lock_res *lockres, 653void ocfs2_file_lock_res_init(struct ocfs2_lock_res *lockres,
@@ -2386,6 +2382,9 @@ int ocfs2_orphan_scan_lock(struct ocfs2_super *osb, u32 *seqno, int ex)
2386 if (ocfs2_dlm_lvb_valid(&lockres->l_lksb) && 2382 if (ocfs2_dlm_lvb_valid(&lockres->l_lksb) &&
2387 lvb->lvb_version == OCFS2_ORPHAN_LVB_VERSION) 2383 lvb->lvb_version == OCFS2_ORPHAN_LVB_VERSION)
2388 *seqno = be32_to_cpu(lvb->lvb_os_seqno); 2384 *seqno = be32_to_cpu(lvb->lvb_os_seqno);
2385 else
2386 *seqno = osb->osb_orphan_scan.os_seqno + 1;
2387
2389 return status; 2388 return status;
2390} 2389}
2391 2390
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index 70215a21fb20..0b2c27a9485e 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -1952,6 +1952,7 @@ int ocfs2_orphan_scan_init(struct ocfs2_super *osb)
1952 atomic_set(&os->os_state, ORPHAN_SCAN_ACTIVE); 1952 atomic_set(&os->os_state, ORPHAN_SCAN_ACTIVE);
1953 os->os_osb = osb; 1953 os->os_osb = osb;
1954 os->os_count = 0; 1954 os->os_count = 0;
1955 os->os_seqno = 0;
1955 os->os_scantime = CURRENT_TIME; 1956 os->os_scantime = CURRENT_TIME;
1956 mutex_init(&os->os_lock); 1957 mutex_init(&os->os_lock);
1957 1958