Commit e37563bb authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'for-4.17-part2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

Pull more btrfs updates from David Sterba:
 "We have queued a few more fixes (error handling, log replay,
  softlockup) and the rest is SPDX updates that touche almost all files
  so the diffstat is long"

* tag 'for-4.17-part2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
  btrfs: Only check first key for committed tree blocks
  btrfs: add SPDX header to Kconfig
  btrfs: replace GPL boilerplate by SPDX -- sources
  btrfs: replace GPL boilerplate by SPDX -- headers
  Btrfs: fix loss of prealloc extents past i_size after fsync log replay
  Btrfs: clean up resources during umount after trans is aborted
  btrfs: Fix possible softlock on single core machines
  Btrfs: bail out on error during replay_dir_deletes
  Btrfs: fix NULL pointer dereference in log_dir_items
parents 09c9b0ea 5d41be6f
# SPDX-License-Identifier: GPL-2.0
config BTRFS_FS config BTRFS_FS
tristate "Btrfs filesystem support" tristate "Btrfs filesystem support"
select LIBCRC32C select LIBCRC32C
......
// SPDX-License-Identifier: GPL-2.0
/* /*
* Copyright (C) 2007 Red Hat. All rights reserved. * Copyright (C) 2007 Red Hat. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#include <linux/fs.h> #include <linux/fs.h>
......
// SPDX-License-Identifier: GPL-2.0
/* /*
* Copyright (C) 2007 Oracle. All rights reserved. * Copyright (C) 2007 Oracle. All rights reserved.
* Copyright (C) 2014 Fujitsu. All rights reserved. * Copyright (C) 2014 Fujitsu. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#include <linux/kthread.h> #include <linux/kthread.h>
......
/* SPDX-License-Identifier: GPL-2.0 */
/* /*
* Copyright (C) 2007 Oracle. All rights reserved. * Copyright (C) 2007 Oracle. All rights reserved.
* Copyright (C) 2014 Fujitsu. All rights reserved. * Copyright (C) 2014 Fujitsu. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#ifndef __BTRFS_ASYNC_THREAD_ #ifndef BTRFS_ASYNC_THREAD_H
#define __BTRFS_ASYNC_THREAD_ #define BTRFS_ASYNC_THREAD_H
#include <linux/workqueue.h> #include <linux/workqueue.h>
struct btrfs_fs_info; struct btrfs_fs_info;
...@@ -85,4 +73,5 @@ void btrfs_set_work_high_priority(struct btrfs_work *work); ...@@ -85,4 +73,5 @@ void btrfs_set_work_high_priority(struct btrfs_work *work);
struct btrfs_fs_info *btrfs_work_owner(const struct btrfs_work *work); struct btrfs_fs_info *btrfs_work_owner(const struct btrfs_work *work);
struct btrfs_fs_info *btrfs_workqueue_owner(const struct __btrfs_workqueue *wq); struct btrfs_fs_info *btrfs_workqueue_owner(const struct __btrfs_workqueue *wq);
bool btrfs_workqueue_normal_congested(const struct btrfs_workqueue *wq); bool btrfs_workqueue_normal_congested(const struct btrfs_workqueue *wq);
#endif #endif
// SPDX-License-Identifier: GPL-2.0
/* /*
* Copyright (C) 2011 STRATO. All rights reserved. * Copyright (C) 2011 STRATO. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#include <linux/mm.h> #include <linux/mm.h>
......
/* SPDX-License-Identifier: GPL-2.0 */
/* /*
* Copyright (C) 2011 STRATO. All rights reserved. * Copyright (C) 2011 STRATO. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#ifndef __BTRFS_BACKREF__ #ifndef BTRFS_BACKREF_H
#define __BTRFS_BACKREF__ #define BTRFS_BACKREF_H
#include <linux/btrfs.h> #include <linux/btrfs.h>
#include "ulist.h" #include "ulist.h"
......
/* SPDX-License-Identifier: GPL-2.0 */
/* /*
* Copyright (C) 2007 Oracle. All rights reserved. * Copyright (C) 2007 Oracle. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#ifndef __BTRFS_I__ #ifndef BTRFS_INODE_H
#define __BTRFS_I__ #define BTRFS_INODE_H
#include <linux/hash.h> #include <linux/hash.h>
#include "extent_map.h" #include "extent_map.h"
......
// SPDX-License-Identifier: GPL-2.0
/* /*
* Copyright (C) STRATO AG 2011. All rights reserved. * Copyright (C) STRATO AG 2011. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
/* /*
......
/* SPDX-License-Identifier: GPL-2.0 */
/* /*
* Copyright (C) STRATO AG 2011. All rights reserved. * Copyright (C) STRATO AG 2011. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#if !defined(__BTRFS_CHECK_INTEGRITY__) #ifndef BTRFS_CHECK_INTEGRITY_H
#define __BTRFS_CHECK_INTEGRITY__ #define BTRFS_CHECK_INTEGRITY_H
#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY #ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
int btrfsic_submit_bh(int op, int op_flags, struct buffer_head *bh); int btrfsic_submit_bh(int op, int op_flags, struct buffer_head *bh);
......
// SPDX-License-Identifier: GPL-2.0
/* /*
* Copyright (C) 2008 Oracle. All rights reserved. * Copyright (C) 2008 Oracle. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#include <linux/kernel.h> #include <linux/kernel.h>
......
/* SPDX-License-Identifier: GPL-2.0 */
/* /*
* Copyright (C) 2008 Oracle. All rights reserved. * Copyright (C) 2008 Oracle. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#ifndef __BTRFS_COMPRESSION_ #ifndef BTRFS_COMPRESSION_H
#define __BTRFS_COMPRESSION_ #define BTRFS_COMPRESSION_H
/* /*
* We want to make sure that amount of RAM required to uncompress an extent is * We want to make sure that amount of RAM required to uncompress an extent is
......
// SPDX-License-Identifier: GPL-2.0
/* /*
* Copyright (C) 2007,2008 Oracle. All rights reserved. * Copyright (C) 2007,2008 Oracle. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#include <linux/sched.h> #include <linux/sched.h>
......
/* SPDX-License-Identifier: GPL-2.0 */
/* /*
* Copyright (C) 2007 Oracle. All rights reserved. * Copyright (C) 2007 Oracle. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#ifndef __BTRFS_CTREE__ #ifndef BTRFS_CTREE_H
#define __BTRFS_CTREE__ #define BTRFS_CTREE_H
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/sched/signal.h> #include <linux/sched/signal.h>
...@@ -3752,4 +3739,5 @@ static inline int btrfs_is_testing(struct btrfs_fs_info *fs_info) ...@@ -3752,4 +3739,5 @@ static inline int btrfs_is_testing(struct btrfs_fs_info *fs_info)
#endif #endif
return 0; return 0;
} }
#endif #endif
/* SPDX-License-Identifier: GPL-2.0 */
/* /*
* Copyright (C) 2016 Fujitsu. All rights reserved. * Copyright (C) 2016 Fujitsu. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#ifndef __BTRFS_DEDUPE__ #ifndef BTRFS_DEDUPE_H
#define __BTRFS_DEDUPE__ #define BTRFS_DEDUPE_H
/* later in-band dedupe will expand this struct */ /* later in-band dedupe will expand this struct */
struct btrfs_dedupe_hash; struct btrfs_dedupe_hash;
#endif #endif
// SPDX-License-Identifier: GPL-2.0
/* /*
* Copyright (C) 2011 Fujitsu. All rights reserved. * Copyright (C) 2011 Fujitsu. All rights reserved.
* Written by Miao Xie <miaox@cn.fujitsu.com> * Written by Miao Xie <miaox@cn.fujitsu.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#include <linux/slab.h> #include <linux/slab.h>
......
/* SPDX-License-Identifier: GPL-2.0 */
/* /*
* Copyright (C) 2011 Fujitsu. All rights reserved. * Copyright (C) 2011 Fujitsu. All rights reserved.
* Written by Miao Xie <miaox@cn.fujitsu.com> * Written by Miao Xie <miaox@cn.fujitsu.com>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#ifndef __DELAYED_TREE_OPERATION_H #ifndef BTRFS_DELAYED_INODE_H
#define __DELAYED_TREE_OPERATION_H #define BTRFS_DELAYED_INODE_H
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
......
// SPDX-License-Identifier: GPL-2.0
/* /*
* Copyright (C) 2009 Oracle. All rights reserved. * Copyright (C) 2009 Oracle. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#include <linux/sched.h> #include <linux/sched.h>
......
/* SPDX-License-Identifier: GPL-2.0 */
/* /*
* Copyright (C) 2008 Oracle. All rights reserved. * Copyright (C) 2008 Oracle. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#ifndef __DELAYED_REF__
#define __DELAYED_REF__ #ifndef BTRFS_DELAYED_REF_H
#define BTRFS_DELAYED_REF_H
#include <linux/refcount.h> #include <linux/refcount.h>
...@@ -298,4 +286,5 @@ btrfs_delayed_node_to_data_ref(struct btrfs_delayed_ref_node *node) ...@@ -298,4 +286,5 @@ btrfs_delayed_node_to_data_ref(struct btrfs_delayed_ref_node *node)
{ {
return container_of(node, struct btrfs_delayed_data_ref, node); return container_of(node, struct btrfs_delayed_data_ref, node);
} }
#endif #endif
// SPDX-License-Identifier: GPL-2.0
/* /*
* Copyright (C) STRATO AG 2012. All rights reserved. * Copyright (C) STRATO AG 2012. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/bio.h> #include <linux/bio.h>
#include <linux/slab.h> #include <linux/slab.h>
......
/* SPDX-License-Identifier: GPL-2.0 */
/* /*
* Copyright (C) STRATO AG 2012. All rights reserved. * Copyright (C) STRATO AG 2012. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#if !defined(__BTRFS_DEV_REPLACE__) #ifndef BTRFS_DEV_REPLACE_H
#define __BTRFS_DEV_REPLACE__ #define BTRFS_DEV_REPLACE_H
struct btrfs_ioctl_dev_replace_args; struct btrfs_ioctl_dev_replace_args;
...@@ -48,4 +35,5 @@ static inline void btrfs_dev_replace_stats_inc(atomic64_t *stat_value) ...@@ -48,4 +35,5 @@ static inline void btrfs_dev_replace_stats_inc(atomic64_t *stat_value)
{ {
atomic64_inc(stat_value); atomic64_inc(stat_value);
} }
#endif #endif
// SPDX-License-Identifier: GPL-2.0
/* /*
* Copyright (C) 2007 Oracle. All rights reserved. * Copyright (C) 2007 Oracle. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#include "ctree.h" #include "ctree.h"
......
// SPDX-License-Identifier: GPL-2.0
/* /*
* Copyright (C) 2007 Oracle. All rights reserved. * Copyright (C) 2007 Oracle. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#include <linux/fs.h> #include <linux/fs.h>
...@@ -449,6 +436,14 @@ static int verify_level_key(struct btrfs_fs_info *fs_info, ...@@ -449,6 +436,14 @@ static int verify_level_key(struct btrfs_fs_info *fs_info,
if (!first_key) if (!first_key)
return 0; return 0;
/*
* For live tree block (new tree blocks in current transaction),
* we need proper lock context to avoid race, which is impossible here.
* So we only checks tree blocks which is read from disk, whose
* generation <= fs_info->last_trans_committed.
*/
if (btrfs_header_generation(eb) > fs_info->last_trans_committed)
return 0;
if (found_level) if (found_level)
btrfs_node_key_to_cpu(eb, &found_key, 0); btrfs_node_key_to_cpu(eb, &found_key, 0);
else else
...@@ -3812,7 +3807,8 @@ void close_ctree(struct btrfs_fs_info *fs_info) ...@@ -3812,7 +3807,8 @@ void close_ctree(struct btrfs_fs_info *fs_info)
btrfs_err(fs_info, "commit super ret %d", ret); btrfs_err(fs_info, "commit super ret %d", ret);
} }
if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state)) if (test_bit(BTRFS_FS_STATE_ERROR, &fs_info->fs_state) ||
test_bit(BTRFS_FS_STATE_TRANS_ABORTED, &fs_info->fs_state))
btrfs_error_commit_super(fs_info); btrfs_error_commit_super(fs_info);
kthread_stop(fs_info->transaction_kthread); kthread_stop(fs_info->transaction_kthread);
......
/* SPDX-License-Identifier: GPL-2.0 */
/* /*
* Copyright (C) 2007 Oracle. All rights reserved. * Copyright (C) 2007 Oracle. All rights reserved.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public
* License v2 as published by the Free Software Foundation.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public
* License along with this program; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 021110-1307, USA.
*/ */
#ifndef __DISKIO__ #ifndef BTRFS_DISK_IO_H
#define __DISKIO__ #define BTRFS_DISK_IO_H
#define BTRFS_SUPER_INFO_OFFSET SZ_64K #define BTRFS_SUPER_INFO_OFFSET SZ_64K
#define BTRFS_SUPER_INFO_SIZE 4096 #define BTRFS_SUPER_INFO_SIZE 4096
...@@ -169,4 +156,5 @@ static inline void btrfs_set_buffer_lockdep_class(u64 objectid, ...@@ -169,4 +156,5 @@ static inline void btrfs_set_buffer_lockdep_class(u64 objectid,
{ {
} }
#endif #endif
#endif #endif
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/types.h> #include <linux/types.h>
#include "ctree.h" #include "ctree.h"
......