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

Commit c126dea7 authored by Chris Mason's avatar Chris Mason
Browse files

Merge branch 'integrity-check-patch-v2' of git://btrfs.giantdisaster.de/git/btrfs into integration



Conflicts:
	fs/btrfs/ctree.h
	fs/btrfs/super.c

Signed-off-by: default avatarChris Mason <chris.mason@oracle.com>
parents 9785dbdf 21adbd5c
Loading
Loading
Loading
Loading
+19 −0
Original line number Diff line number Diff line
@@ -31,3 +31,22 @@ config BTRFS_FS_POSIX_ACL
	  Linux website <http://acl.bestbits.at/>.

	  If you don't know what Access Control Lists are, say N

config BTRFS_FS_CHECK_INTEGRITY
	bool "Btrfs with integrity check tool compiled in (DANGEROUS)"
	depends on BTRFS_FS
	help
	  Adds code that examines all block write requests (including
	  writes of the super block). The goal is to verify that the
	  state of the filesystem on disk is always consistent, i.e.,
	  after a power-loss or kernel panic event the filesystem is
	  in a consistent state.

	  If the integrity check tool is included and activated in
	  the mount options, plenty of kernel memory is used, and
	  plenty of additional CPU cycles are spent. Enabling this
	  functionality is not intended for normal use.

	  In most cases, unless you are a btrfs developer who needs
	  to verify the integrity of (super)-block write requests
	  during the run of a regression test, say N
+1 −0
Original line number Diff line number Diff line
@@ -11,3 +11,4 @@ btrfs-y += super.o ctree.o extent-tree.o print-tree.o root-tree.o dir-item.o \
	   reada.o backref.o ulist.o

btrfs-$(CONFIG_BTRFS_FS_POSIX_ACL) += acl.o
btrfs-$(CONFIG_BTRFS_FS_CHECK_INTEGRITY) += check-integrity.o
+3068 −0

File added.

Preview size limit exceeded, changes collapsed.

+36 −0
Original line number Diff line number Diff line
/*
 * 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__)
#define __BTRFS_CHECK_INTEGRITY__

#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
int btrfsic_submit_bh(int rw, struct buffer_head *bh);
void btrfsic_submit_bio(int rw, struct bio *bio);
#else
#define btrfsic_submit_bh submit_bh
#define btrfsic_submit_bio submit_bio
#endif

int btrfsic_mount(struct btrfs_root *root,
		  struct btrfs_fs_devices *fs_devices,
		  int including_extent_data, u32 print_mask);
void btrfsic_unmount(struct btrfs_root *root,
		     struct btrfs_fs_devices *fs_devices);

#endif
+7 −1
Original line number Diff line number Diff line
@@ -1041,7 +1041,7 @@ struct btrfs_fs_info {
	 * is required instead of the faster short fsync log commits
	 */
	u64 last_trans_log_full_commit;
	unsigned long mount_opt:20;
	unsigned long mount_opt:21;
	unsigned long compress_type:4;
	u64 max_inline;
	u64 alloc_start;
@@ -1236,6 +1236,10 @@ struct btrfs_fs_info {
	int scrub_workers_refcnt;
	struct btrfs_workers scrub_workers;

#ifdef CONFIG_BTRFS_FS_CHECK_INTEGRITY
	u32 check_integrity_print_mask;
#endif

	/* filesystem state */
	u64 fs_state;

@@ -1497,6 +1501,8 @@ struct btrfs_ioctl_defrag_range_args {
#define BTRFS_MOUNT_INODE_MAP_CACHE	(1 << 17)
#define BTRFS_MOUNT_RECOVERY		(1 << 18)
#define BTRFS_MOUNT_SKIP_BALANCE	(1 << 19)
#define BTRFS_MOUNT_CHECK_INTEGRITY	(1 << 20)
#define BTRFS_MOUNT_CHECK_INTEGRITY_INCLUDING_EXTENT_DATA (1 << 21)

#define btrfs_clear_opt(o, opt)		((o) &= ~BTRFS_MOUNT_##opt)
#define btrfs_set_opt(o, opt)		((o) |= BTRFS_MOUNT_##opt)
Loading