diff options
author | Jeff Mahoney <jeffm@suse.com> | 2009-07-07 17:22:12 -0400 |
---|---|---|
committer | Joel Becker <joel.becker@oracle.com> | 2009-07-08 15:34:02 -0700 |
commit | 8b712cd58adfe6aeeb0be4ecc011dc35620719e7 (patch) | |
tree | 98a0cdc0b210392fc0fd0feb464603224c2863b1 /fs/ocfs2/journal.c | |
parent | 44b572809581d5a10dbe35aa6bf689f32b9c5ad6 (diff) | |
download | blackbird-op-linux-8b712cd58adfe6aeeb0be4ecc011dc35620719e7.tar.gz blackbird-op-linux-8b712cd58adfe6aeeb0be4ecc011dc35620719e7.zip |
ocfs2: Fixup orphan scan cleanup after failed mount
If the mount fails for any reason, ocfs2_dismount_volume calls
ocfs2_orphan_scan_stop. It requires that ocfs2_orphan_scan_init
be called to setup the mutex and work queues, but that doesn't
happen if the mount has failed and we oops accessing an uninitialized
work queue.
This patch splits the init and startup of the orphan scan, eliminating
the oops.
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Signed-off-by: Joel Becker <joel.becker@oracle.com>
Diffstat (limited to 'fs/ocfs2/journal.c')
-rw-r--r-- | fs/ocfs2/journal.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index f033760ecbea..c48b93ac6b65 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -1954,10 +1954,16 @@ void ocfs2_orphan_scan_init(struct ocfs2_super *osb) os->os_osb = osb; os->os_count = 0; os->os_seqno = 0; - os->os_scantime = CURRENT_TIME; mutex_init(&os->os_lock); INIT_DELAYED_WORK(&os->os_orphan_scan_work, ocfs2_orphan_scan_work); +} +void ocfs2_orphan_scan_start(struct ocfs2_super *osb) +{ + struct ocfs2_orphan_scan *os; + + os = &osb->osb_orphan_scan; + os->os_scantime = CURRENT_TIME; if (ocfs2_is_hard_readonly(osb) || ocfs2_mount_local(osb)) atomic_set(&os->os_state, ORPHAN_SCAN_INACTIVE); else { |