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

Commit c761923c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

Pull ext4 fixes from Ted Ts'o:
 "A few bug fixes and add some missing KERN_CONT annotations"

* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: add missing KERN_CONT to a few more debugging uses
  fscrypto: lock inode while setting encryption policy
  ext4: correct endianness conversion in __xattr_check_inode()
  fscrypto: make XTS tweak initialization endian-independent
  ext4: do not advertise encryption support when disabled
  jbd2: fix incorrect unlock on j_list_lock
  ext4: super.c: Update logging style using KERN_CONT
parents a55da8a0 d74f3d25
Loading
Loading
Loading
Loading
+8 −7
Original line number Diff line number Diff line
@@ -151,7 +151,10 @@ static int do_page_crypto(struct inode *inode,
			struct page *src_page, struct page *dest_page,
			gfp_t gfp_flags)
{
	u8 xts_tweak[FS_XTS_TWEAK_SIZE];
	struct {
		__le64 index;
		u8 padding[FS_XTS_TWEAK_SIZE - sizeof(__le64)];
	} xts_tweak;
	struct skcipher_request *req = NULL;
	DECLARE_FS_COMPLETION_RESULT(ecr);
	struct scatterlist dst, src;
@@ -171,17 +174,15 @@ static int do_page_crypto(struct inode *inode,
		req, CRYPTO_TFM_REQ_MAY_BACKLOG | CRYPTO_TFM_REQ_MAY_SLEEP,
		page_crypt_complete, &ecr);

	BUILD_BUG_ON(FS_XTS_TWEAK_SIZE < sizeof(index));
	memcpy(xts_tweak, &index, sizeof(index));
	memset(&xts_tweak[sizeof(index)], 0,
			FS_XTS_TWEAK_SIZE - sizeof(index));
	BUILD_BUG_ON(sizeof(xts_tweak) != FS_XTS_TWEAK_SIZE);
	xts_tweak.index = cpu_to_le64(index);
	memset(xts_tweak.padding, 0, sizeof(xts_tweak.padding));

	sg_init_table(&dst, 1);
	sg_set_page(&dst, dest_page, PAGE_SIZE, 0);
	sg_init_table(&src, 1);
	sg_set_page(&src, src_page, PAGE_SIZE, 0);
	skcipher_request_set_crypt(req, &src, &dst, PAGE_SIZE,
					xts_tweak);
	skcipher_request_set_crypt(req, &src, &dst, PAGE_SIZE, &xts_tweak);
	if (rw == FS_DECRYPT)
		res = crypto_skcipher_decrypt(req);
	else
+4 −0
Original line number Diff line number Diff line
@@ -109,6 +109,8 @@ int fscrypt_process_policy(struct file *filp,
	if (ret)
		return ret;

	inode_lock(inode);

	if (!inode_has_encryption_context(inode)) {
		if (!S_ISDIR(inode->i_mode))
			ret = -EINVAL;
@@ -127,6 +129,8 @@ int fscrypt_process_policy(struct file *filp,
		ret = -EINVAL;
	}

	inode_unlock(inode);

	mnt_drop_write_file(filp);
	return ret;
}
+2 −2
Original line number Diff line number Diff line
@@ -128,12 +128,12 @@ static void debug_print_tree(struct ext4_sb_info *sbi)
	node = rb_first(&sbi->system_blks);
	while (node) {
		entry = rb_entry(node, struct ext4_system_zone, node);
		printk("%s%llu-%llu", first ? "" : ", ",
		printk(KERN_CONT "%s%llu-%llu", first ? "" : ", ",
		       entry->start_blk, entry->start_blk + entry->count - 1);
		first = 0;
		node = rb_next(node);
	}
	printk("\n");
	printk(KERN_CONT "\n");
}

int ext4_setup_system_zone(struct super_block *sb)
+8 −9
Original line number Diff line number Diff line
@@ -27,16 +27,15 @@
#ifdef CONFIG_EXT4_DEBUG
extern ushort ext4_mballoc_debug;

#define mb_debug(n, fmt, a...)	                                        \
#define mb_debug(n, fmt, ...)	                                        \
do {									\
	if ((n) <= ext4_mballoc_debug) {				\
			printk(KERN_DEBUG "(%s, %d): %s: ",		\
			       __FILE__, __LINE__, __func__);		\
			printk(fmt, ## a);				\
		printk(KERN_DEBUG "(%s, %d): %s: " fmt,			\
		       __FILE__, __LINE__, __func__, ##__VA_ARGS__);	\
	}								\
} while (0)
#else
#define mb_debug(n, fmt, a...)		no_printk(fmt, ## a)
#define mb_debug(n, fmt, ...)	no_printk(fmt, ##__VA_ARGS__)
#endif

#define EXT4_MB_HISTORY_ALLOC		1	/* allocation */
+10 −8
Original line number Diff line number Diff line
@@ -579,10 +579,11 @@ static void dx_show_index(char * label, struct dx_entry *entries)
	int i, n = dx_get_count (entries);
	printk(KERN_DEBUG "%s index", label);
	for (i = 0; i < n; i++) {
		printk("%x->%lu ", i ? dx_get_hash(entries + i) :
				0, (unsigned long)dx_get_block(entries + i));
		printk(KERN_CONT " %x->%lu",
		       i ? dx_get_hash(entries + i) : 0,
		       (unsigned long)dx_get_block(entries + i));
	}
	printk("\n");
	printk(KERN_CONT "\n");
}

struct stats
@@ -679,7 +680,7 @@ static struct stats dx_show_leaf(struct inode *dir,
		}
		de = ext4_next_entry(de, size);
	}
	printk("(%i)\n", names);
	printk(KERN_CONT "(%i)\n", names);
	return (struct stats) { names, space, 1 };
}

@@ -798,7 +799,7 @@ dx_probe(struct ext4_filename *fname, struct inode *dir,
		q = entries + count - 1;
		while (p <= q) {
			m = p + (q - p) / 2;
			dxtrace(printk("."));
			dxtrace(printk(KERN_CONT "."));
			if (dx_get_hash(m) > hash)
				q = m - 1;
			else
@@ -810,7 +811,7 @@ dx_probe(struct ext4_filename *fname, struct inode *dir,
			at = entries;
			while (n--)
			{
				dxtrace(printk(","));
				dxtrace(printk(KERN_CONT ","));
				if (dx_get_hash(++at) > hash)
				{
					at--;
@@ -821,7 +822,8 @@ dx_probe(struct ext4_filename *fname, struct inode *dir,
		}

		at = p - 1;
		dxtrace(printk(" %x->%u\n", at == entries ? 0 : dx_get_hash(at),
		dxtrace(printk(KERN_CONT " %x->%u\n",
			       at == entries ? 0 : dx_get_hash(at),
			       dx_get_block(at)));
		frame->entries = entries;
		frame->at = at;
Loading