Commit 3211949f8998dde71d9fe2e063de045ece5e0473

Authored by Sunil Mushran
Committed by Joel Becker
1 parent 692684e19e

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>

Showing 2 changed files with 4 additions and 4 deletions Side-by-side Diff

... ... @@ -644,14 +644,10 @@
644 644 static void ocfs2_orphan_scan_lock_res_init(struct ocfs2_lock_res *res,
645 645 struct ocfs2_super *osb)
646 646 {
647   - struct ocfs2_orphan_scan_lvb *lvb;
648   -
649 647 ocfs2_lock_res_init_once(res);
650 648 ocfs2_build_lock_name(OCFS2_LOCK_TYPE_ORPHAN_SCAN, 0, 0, res->l_name);
651 649 ocfs2_lock_res_init_common(osb, res, OCFS2_LOCK_TYPE_ORPHAN_SCAN,
652 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  
657 653 void ocfs2_file_lock_res_init(struct ocfs2_lock_res *lockres,
... ... @@ -2386,6 +2382,9 @@
2386 2382 if (ocfs2_dlm_lvb_valid(&lockres->l_lksb) &&
2387 2383 lvb->lvb_version == OCFS2_ORPHAN_LVB_VERSION)
2388 2384 *seqno = be32_to_cpu(lvb->lvb_os_seqno);
  2385 + else
  2386 + *seqno = osb->osb_orphan_scan.os_seqno + 1;
  2387 +
2389 2388 return status;
2390 2389 }
2391 2390  
... ... @@ -1952,6 +1952,7 @@
1952 1952 atomic_set(&os->os_state, ORPHAN_SCAN_ACTIVE);
1953 1953 os->os_osb = osb;
1954 1954 os->os_count = 0;
  1955 + os->os_seqno = 0;
1955 1956 os->os_scantime = CURRENT_TIME;
1956 1957 mutex_init(&os->os_lock);
1957 1958