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 branch 'for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs

Pull btrfs fixes from Chris Mason:
"This has two last minute fixes. The highest priority here is a
regression fix for the decompression code, but we also fixed up a
problem with the 32-bit compat ioctls.

The decompression bug could hand back the wrong data on big reads when
zlib was used. I have a larger cleanup to make the math here less
error prone, but at this stage in the release Omar's patch is the best
choice"

* 'for-linus-4.10' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
btrfs: fix btrfs_decompress_buf2page()
btrfs: fix btrfs_compat_ioctl failures on non-compat ioctls

+28 -17
+24 -15
fs/btrfs/compression.c
··· 1024 1024 unsigned long buf_offset; 1025 1025 unsigned long current_buf_start; 1026 1026 unsigned long start_byte; 1027 + unsigned long prev_start_byte; 1027 1028 unsigned long working_bytes = total_out - buf_start; 1028 1029 unsigned long bytes; 1029 1030 char *kaddr; ··· 1072 1071 if (!bio->bi_iter.bi_size) 1073 1072 return 0; 1074 1073 bvec = bio_iter_iovec(bio, bio->bi_iter); 1075 - 1074 + prev_start_byte = start_byte; 1076 1075 start_byte = page_offset(bvec.bv_page) - disk_start; 1077 1076 1078 1077 /* 1079 - * make sure our new page is covered by this 1080 - * working buffer 1078 + * We need to make sure we're only adjusting 1079 + * our offset into compression working buffer when 1080 + * we're switching pages. Otherwise we can incorrectly 1081 + * keep copying when we were actually done. 1081 1082 */ 1082 - if (total_out <= start_byte) 1083 - return 1; 1083 + if (start_byte != prev_start_byte) { 1084 + /* 1085 + * make sure our new page is covered by this 1086 + * working buffer 1087 + */ 1088 + if (total_out <= start_byte) 1089 + return 1; 1084 1090 1085 - /* 1086 - * the next page in the biovec might not be adjacent 1087 - * to the last page, but it might still be found 1088 - * inside this working buffer. bump our offset pointer 1089 - */ 1090 - if (total_out > start_byte && 1091 - current_buf_start < start_byte) { 1092 - buf_offset = start_byte - buf_start; 1093 - working_bytes = total_out - start_byte; 1094 - current_buf_start = buf_start + buf_offset; 1091 + /* 1092 + * the next page in the biovec might not be adjacent 1093 + * to the last page, but it might still be found 1094 + * inside this working buffer. bump our offset pointer 1095 + */ 1096 + if (total_out > start_byte && 1097 + current_buf_start < start_byte) { 1098 + buf_offset = start_byte - buf_start; 1099 + working_bytes = total_out - start_byte; 1100 + current_buf_start = buf_start + buf_offset; 1101 + } 1095 1102 } 1096 1103 } 1097 1104
+4 -2
fs/btrfs/ioctl.c
··· 5653 5653 #ifdef CONFIG_COMPAT 5654 5654 long btrfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 5655 5655 { 5656 + /* 5657 + * These all access 32-bit values anyway so no further 5658 + * handling is necessary. 5659 + */ 5656 5660 switch (cmd) { 5657 5661 case FS_IOC32_GETFLAGS: 5658 5662 cmd = FS_IOC_GETFLAGS; ··· 5667 5663 case FS_IOC32_GETVERSION: 5668 5664 cmd = FS_IOC_GETVERSION; 5669 5665 break; 5670 - default: 5671 - return -ENOIOCTLCMD; 5672 5666 } 5673 5667 5674 5668 return btrfs_ioctl(file, cmd, (unsigned long) compat_ptr(arg));