Browse Source

Btrfs: check return value for kthread_run() correctly

kthread_run() returns the kthread or ERR_PTR(-ENOMEM), not NULL.

Signed-off-by: Qinghuang Feng <qhfeng.kernel@gmail.com>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Qinghuang Feng 16 years ago
parent
commit
57506d50ed
1 changed files with 2 additions and 2 deletions
  1. 2 2
      fs/btrfs/disk-io.c

+ 2 - 2
fs/btrfs/disk-io.c

@@ -1739,13 +1739,13 @@ struct btrfs_root *open_ctree(struct super_block *sb,
 	fs_info->system_alloc_profile = fs_info->metadata_alloc_profile;
 	fs_info->system_alloc_profile = fs_info->metadata_alloc_profile;
 	fs_info->cleaner_kthread = kthread_run(cleaner_kthread, tree_root,
 	fs_info->cleaner_kthread = kthread_run(cleaner_kthread, tree_root,
 					       "btrfs-cleaner");
 					       "btrfs-cleaner");
-	if (!fs_info->cleaner_kthread)
+	if (IS_ERR(fs_info->cleaner_kthread))
 		goto fail_csum_root;
 		goto fail_csum_root;
 
 
 	fs_info->transaction_kthread = kthread_run(transaction_kthread,
 	fs_info->transaction_kthread = kthread_run(transaction_kthread,
 						   tree_root,
 						   tree_root,
 						   "btrfs-transaction");
 						   "btrfs-transaction");
-	if (!fs_info->transaction_kthread)
+	if (IS_ERR(fs_info->transaction_kthread))
 		goto fail_cleaner;
 		goto fail_cleaner;
 
 
 	if (btrfs_super_log_root(disk_super) != 0) {
 	if (btrfs_super_log_root(disk_super) != 0) {