Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

+56 -50
+8 -7
fs/crypto/crypto.c
··· 151 151 struct page *src_page, struct page *dest_page, 152 152 gfp_t gfp_flags) 153 153 { 154 - u8 xts_tweak[FS_XTS_TWEAK_SIZE]; 154 + struct { 155 + __le64 index; 156 + u8 padding[FS_XTS_TWEAK_SIZE - sizeof(__le64)]; 157 + } xts_tweak; 155 158 struct skcipher_request *req = NULL; 156 159 DECLARE_FS_COMPLETION_RESULT(ecr); 157 160 struct scatterlist dst, src; ··· 174 171 req, CRYPTO_TFM_REQ_MAY_BACKLOG | CRYPTO_TFM_REQ_MAY_SLEEP, 175 172 page_crypt_complete, &ecr); 176 173 177 - BUILD_BUG_ON(FS_XTS_TWEAK_SIZE < sizeof(index)); 178 - memcpy(xts_tweak, &index, sizeof(index)); 179 - memset(&xts_tweak[sizeof(index)], 0, 180 - FS_XTS_TWEAK_SIZE - sizeof(index)); 174 + BUILD_BUG_ON(sizeof(xts_tweak) != FS_XTS_TWEAK_SIZE); 175 + xts_tweak.index = cpu_to_le64(index); 176 + memset(xts_tweak.padding, 0, sizeof(xts_tweak.padding)); 181 177 182 178 sg_init_table(&dst, 1); 183 179 sg_set_page(&dst, dest_page, PAGE_SIZE, 0); 184 180 sg_init_table(&src, 1); 185 181 sg_set_page(&src, src_page, PAGE_SIZE, 0); 186 - skcipher_request_set_crypt(req, &src, &dst, PAGE_SIZE, 187 - xts_tweak); 182 + skcipher_request_set_crypt(req, &src, &dst, PAGE_SIZE, &xts_tweak); 188 183 if (rw == FS_DECRYPT) 189 184 res = crypto_skcipher_decrypt(req); 190 185 else
+4
fs/crypto/policy.c
··· 109 109 if (ret) 110 110 return ret; 111 111 112 + inode_lock(inode); 113 + 112 114 if (!inode_has_encryption_context(inode)) { 113 115 if (!S_ISDIR(inode->i_mode)) 114 116 ret = -EINVAL; ··· 128 126 __func__); 129 127 ret = -EINVAL; 130 128 } 129 + 130 + inode_unlock(inode); 131 131 132 132 mnt_drop_write_file(filp); 133 133 return ret;
+2 -2
fs/ext4/block_validity.c
··· 128 128 node = rb_first(&sbi->system_blks); 129 129 while (node) { 130 130 entry = rb_entry(node, struct ext4_system_zone, node); 131 - printk("%s%llu-%llu", first ? "" : ", ", 131 + printk(KERN_CONT "%s%llu-%llu", first ? "" : ", ", 132 132 entry->start_blk, entry->start_blk + entry->count - 1); 133 133 first = 0; 134 134 node = rb_next(node); 135 135 } 136 - printk("\n"); 136 + printk(KERN_CONT "\n"); 137 137 } 138 138 139 139 int ext4_setup_system_zone(struct super_block *sb)
+8 -9
fs/ext4/mballoc.h
··· 27 27 #ifdef CONFIG_EXT4_DEBUG 28 28 extern ushort ext4_mballoc_debug; 29 29 30 - #define mb_debug(n, fmt, a...) \ 31 - do { \ 32 - if ((n) <= ext4_mballoc_debug) { \ 33 - printk(KERN_DEBUG "(%s, %d): %s: ", \ 34 - __FILE__, __LINE__, __func__); \ 35 - printk(fmt, ## a); \ 36 - } \ 37 - } while (0) 30 + #define mb_debug(n, fmt, ...) \ 31 + do { \ 32 + if ((n) <= ext4_mballoc_debug) { \ 33 + printk(KERN_DEBUG "(%s, %d): %s: " fmt, \ 34 + __FILE__, __LINE__, __func__, ##__VA_ARGS__); \ 35 + } \ 36 + } while (0) 38 37 #else 39 - #define mb_debug(n, fmt, a...) no_printk(fmt, ## a) 38 + #define mb_debug(n, fmt, ...) no_printk(fmt, ##__VA_ARGS__) 40 39 #endif 41 40 42 41 #define EXT4_MB_HISTORY_ALLOC 1 /* allocation */
+10 -8
fs/ext4/namei.c
··· 577 577 static void dx_show_index(char * label, struct dx_entry *entries) 578 578 { 579 579 int i, n = dx_get_count (entries); 580 - printk(KERN_DEBUG "%s index ", label); 580 + printk(KERN_DEBUG "%s index", label); 581 581 for (i = 0; i < n; i++) { 582 - printk("%x->%lu ", i ? dx_get_hash(entries + i) : 583 - 0, (unsigned long)dx_get_block(entries + i)); 582 + printk(KERN_CONT " %x->%lu", 583 + i ? dx_get_hash(entries + i) : 0, 584 + (unsigned long)dx_get_block(entries + i)); 584 585 } 585 - printk("\n"); 586 + printk(KERN_CONT "\n"); 586 587 } 587 588 588 589 struct stats ··· 680 679 } 681 680 de = ext4_next_entry(de, size); 682 681 } 683 - printk("(%i)\n", names); 682 + printk(KERN_CONT "(%i)\n", names); 684 683 return (struct stats) { names, space, 1 }; 685 684 } 686 685 ··· 799 798 q = entries + count - 1; 800 799 while (p <= q) { 801 800 m = p + (q - p) / 2; 802 - dxtrace(printk(".")); 801 + dxtrace(printk(KERN_CONT ".")); 803 802 if (dx_get_hash(m) > hash) 804 803 q = m - 1; 805 804 else ··· 811 810 at = entries; 812 811 while (n--) 813 812 { 814 - dxtrace(printk(",")); 813 + dxtrace(printk(KERN_CONT ",")); 815 814 if (dx_get_hash(++at) > hash) 816 815 { 817 816 at--; ··· 822 821 } 823 822 824 823 at = p - 1; 825 - dxtrace(printk(" %x->%u\n", at == entries ? 0 : dx_get_hash(at), 824 + dxtrace(printk(KERN_CONT " %x->%u\n", 825 + at == entries ? 0 : dx_get_hash(at), 826 826 dx_get_block(at))); 827 827 frame->entries = entries; 828 828 frame->at = at;
+11 -10
fs/ext4/super.c
··· 597 597 void __ext4_abort(struct super_block *sb, const char *function, 598 598 unsigned int line, const char *fmt, ...) 599 599 { 600 + struct va_format vaf; 600 601 va_list args; 601 602 602 603 save_error_info(sb, function, line); 603 604 va_start(args, fmt); 604 - printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: ", sb->s_id, 605 - function, line); 606 - vprintk(fmt, args); 607 - printk("\n"); 605 + vaf.fmt = fmt; 606 + vaf.va = &args; 607 + printk(KERN_CRIT "EXT4-fs error (device %s): %s:%d: %pV\n", 608 + sb->s_id, function, line, &vaf); 608 609 va_end(args); 609 610 610 611 if ((sb->s_flags & MS_RDONLY) == 0) { ··· 2716 2715 es->s_first_error_func, 2717 2716 le32_to_cpu(es->s_first_error_line)); 2718 2717 if (es->s_first_error_ino) 2719 - printk(": inode %u", 2718 + printk(KERN_CONT ": inode %u", 2720 2719 le32_to_cpu(es->s_first_error_ino)); 2721 2720 if (es->s_first_error_block) 2722 - printk(": block %llu", (unsigned long long) 2721 + printk(KERN_CONT ": block %llu", (unsigned long long) 2723 2722 le64_to_cpu(es->s_first_error_block)); 2724 - printk("\n"); 2723 + printk(KERN_CONT "\n"); 2725 2724 } 2726 2725 if (es->s_last_error_time) { 2727 2726 printk(KERN_NOTICE "EXT4-fs (%s): last error at time %u: %.*s:%d", ··· 2730 2729 es->s_last_error_func, 2731 2730 le32_to_cpu(es->s_last_error_line)); 2732 2731 if (es->s_last_error_ino) 2733 - printk(": inode %u", 2732 + printk(KERN_CONT ": inode %u", 2734 2733 le32_to_cpu(es->s_last_error_ino)); 2735 2734 if (es->s_last_error_block) 2736 - printk(": block %llu", (unsigned long long) 2735 + printk(KERN_CONT ": block %llu", (unsigned long long) 2737 2736 le64_to_cpu(es->s_last_error_block)); 2738 - printk("\n"); 2737 + printk(KERN_CONT "\n"); 2739 2738 } 2740 2739 mod_timer(&sbi->s_err_report, jiffies + 24*60*60*HZ); /* Once a day */ 2741 2740 }
+4
fs/ext4/sysfs.c
··· 223 223 EXT4_ATTR_FEATURE(lazy_itable_init); 224 224 EXT4_ATTR_FEATURE(batched_discard); 225 225 EXT4_ATTR_FEATURE(meta_bg_resize); 226 + #ifdef CONFIG_EXT4_FS_ENCRYPTION 226 227 EXT4_ATTR_FEATURE(encryption); 228 + #endif 227 229 EXT4_ATTR_FEATURE(metadata_csum_seed); 228 230 229 231 static struct attribute *ext4_feat_attrs[] = { 230 232 ATTR_LIST(lazy_itable_init), 231 233 ATTR_LIST(batched_discard), 232 234 ATTR_LIST(meta_bg_resize), 235 + #ifdef CONFIG_EXT4_FS_ENCRYPTION 233 236 ATTR_LIST(encryption), 237 + #endif 234 238 ATTR_LIST(metadata_csum_seed), 235 239 NULL, 236 240 };
+7 -13
fs/ext4/xattr.c
··· 61 61 #include "acl.h" 62 62 63 63 #ifdef EXT4_XATTR_DEBUG 64 - # define ea_idebug(inode, f...) do { \ 65 - printk(KERN_DEBUG "inode %s:%lu: ", \ 66 - inode->i_sb->s_id, inode->i_ino); \ 67 - printk(f); \ 68 - printk("\n"); \ 69 - } while (0) 70 - # define ea_bdebug(bh, f...) do { \ 71 - printk(KERN_DEBUG "block %pg:%lu: ", \ 72 - bh->b_bdev, (unsigned long) bh->b_blocknr); \ 73 - printk(f); \ 74 - printk("\n"); \ 75 - } while (0) 64 + # define ea_idebug(inode, fmt, ...) \ 65 + printk(KERN_DEBUG "inode %s:%lu: " fmt "\n", \ 66 + inode->i_sb->s_id, inode->i_ino, ##__VA_ARGS__) 67 + # define ea_bdebug(bh, fmt, ...) \ 68 + printk(KERN_DEBUG "block %pg:%lu: " fmt "\n", \ 69 + bh->b_bdev, (unsigned long)bh->b_blocknr, ##__VA_ARGS__) 76 70 #else 77 71 # define ea_idebug(inode, fmt, ...) no_printk(fmt, ##__VA_ARGS__) 78 72 # define ea_bdebug(bh, fmt, ...) no_printk(fmt, ##__VA_ARGS__) ··· 235 241 int error = -EFSCORRUPTED; 236 242 237 243 if (((void *) header >= end) || 238 - (header->h_magic != le32_to_cpu(EXT4_XATTR_MAGIC))) 244 + (header->h_magic != cpu_to_le32(EXT4_XATTR_MAGIC))) 239 245 goto errout; 240 246 error = ext4_xattr_check_names(entry, end, entry); 241 247 errout:
+2 -1
fs/jbd2/transaction.c
··· 1149 1149 JBUFFER_TRACE(jh, "file as BJ_Reserved"); 1150 1150 spin_lock(&journal->j_list_lock); 1151 1151 __jbd2_journal_file_buffer(jh, transaction, BJ_Reserved); 1152 + spin_unlock(&journal->j_list_lock); 1152 1153 } else if (jh->b_transaction == journal->j_committing_transaction) { 1153 1154 /* first access by this transaction */ 1154 1155 jh->b_modified = 0; ··· 1157 1156 JBUFFER_TRACE(jh, "set next transaction"); 1158 1157 spin_lock(&journal->j_list_lock); 1159 1158 jh->b_next_transaction = transaction; 1159 + spin_unlock(&journal->j_list_lock); 1160 1160 } 1161 - spin_unlock(&journal->j_list_lock); 1162 1161 jbd_unlock_bh_state(bh); 1163 1162 1164 1163 /*