Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99c705af authored by Krishna Konda's avatar Krishna Konda
Browse files

fs: yaffs2: initialize delayed workqueue before using it



The sync_work delayed workqueue needs to be initialized before
its gets used for the first time or else it will result in a crash.

Change-Id: I7f627b1cbe5c68031707f3b3943381a2353fce74
Signed-off-by: default avatarKrishna Konda <kkonda@codeaurora.org>
parent 0f8fb3e5
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -2376,6 +2376,10 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version,

	yaffs_gross_lock(dev);

	spin_lock_init(&yaffs_dev_to_lc(dev)->work_lock);
	INIT_DELAYED_WORK(&yaffs_dev_to_lc(dev)->sync_work,
				yaffs_delayed_sync_fs);

	err = yaffs_guts_initialise(dev);

	yaffs_trace(YAFFS_TRACE_OS,
@@ -2412,9 +2416,7 @@ static struct super_block *yaffs_internal_read_super(int yaffs_version,
		return NULL;
	}
	sb->s_root = root;
	spin_lock_init(&yaffs_dev_to_lc(dev)->work_lock);
	INIT_DELAYED_WORK(&yaffs_dev_to_lc(dev)->sync_work,
				yaffs_delayed_sync_fs);

	if (!dev->is_checkpointed)
		yaffs_mark_sb_dirty(sb);
	yaffs_trace(YAFFS_TRACE_ALWAYS,