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 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm

Pull libnvdimm fixes from Dan Williams:

- A collection of crash and deadlock fixes for DAX that are also tagged
for -stable. We will look to re-enable DAX pmd mappings in 4.5, but
for now 4.4 and -stable should disable it by default.

- A fixup to ext2 and ext4 to mirror the same warning emitted by XFS
when mounting with "-o dax"

* 'libnvdimm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm:
block: protect rw_page against device teardown
mm, dax: fix DAX deadlocks (COW fault)
dax: disable pmd mappings
ext2, ext4: warn when mounting with dax enabled

+39 -9
-2
block/blk.h
··· 72 72 void __blk_queue_free_tags(struct request_queue *q); 73 73 bool __blk_end_bidi_request(struct request *rq, int error, 74 74 unsigned int nr_bytes, unsigned int bidi_bytes); 75 - int blk_queue_enter(struct request_queue *q, gfp_t gfp); 76 - void blk_queue_exit(struct request_queue *q); 77 75 void blk_freeze_queue(struct request_queue *q); 78 76 79 77 static inline void blk_queue_enter_live(struct request_queue *q)
+6
fs/Kconfig
··· 46 46 or if unsure, say N. Saying Y will increase the size of the kernel 47 47 by about 5kB. 48 48 49 + config FS_DAX_PMD 50 + bool 51 + default FS_DAX 52 + depends on FS_DAX 53 + depends on BROKEN 54 + 49 55 endif # BLOCK 50 56 51 57 # Posix ACL utility routines
+16 -2
fs/block_dev.c
··· 390 390 struct page *page) 391 391 { 392 392 const struct block_device_operations *ops = bdev->bd_disk->fops; 393 + int result = -EOPNOTSUPP; 394 + 393 395 if (!ops->rw_page || bdev_get_integrity(bdev)) 394 - return -EOPNOTSUPP; 395 - return ops->rw_page(bdev, sector + get_start_sect(bdev), page, READ); 396 + return result; 397 + 398 + result = blk_queue_enter(bdev->bd_queue, GFP_KERNEL); 399 + if (result) 400 + return result; 401 + result = ops->rw_page(bdev, sector + get_start_sect(bdev), page, READ); 402 + blk_queue_exit(bdev->bd_queue); 403 + return result; 396 404 } 397 405 EXPORT_SYMBOL_GPL(bdev_read_page); 398 406 ··· 429 421 int result; 430 422 int rw = (wbc->sync_mode == WB_SYNC_ALL) ? WRITE_SYNC : WRITE; 431 423 const struct block_device_operations *ops = bdev->bd_disk->fops; 424 + 432 425 if (!ops->rw_page || bdev_get_integrity(bdev)) 433 426 return -EOPNOTSUPP; 427 + result = blk_queue_enter(bdev->bd_queue, GFP_KERNEL); 428 + if (result) 429 + return result; 430 + 434 431 set_page_writeback(page); 435 432 result = ops->rw_page(bdev, sector + get_start_sect(bdev), page, rw); 436 433 if (result) 437 434 end_page_writeback(page); 438 435 else 439 436 unlock_page(page); 437 + blk_queue_exit(bdev->bd_queue); 440 438 return result; 441 439 } 442 440 EXPORT_SYMBOL_GPL(bdev_write_page);
+4
fs/dax.c
··· 541 541 unsigned long pfn; 542 542 int result = 0; 543 543 544 + /* dax pmd mappings are broken wrt gup and fork */ 545 + if (!IS_ENABLED(CONFIG_FS_DAX_PMD)) 546 + return VM_FAULT_FALLBACK; 547 + 544 548 /* Fall back to PTEs if we're going to COW */ 545 549 if (write && !(vma->vm_flags & VM_SHARED)) 546 550 return VM_FAULT_FALLBACK;
+2
fs/ext2/super.c
··· 569 569 /* Fall through */ 570 570 case Opt_dax: 571 571 #ifdef CONFIG_FS_DAX 572 + ext2_msg(sb, KERN_WARNING, 573 + "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); 572 574 set_opt(sbi->s_mount_opt, DAX); 573 575 #else 574 576 ext2_msg(sb, KERN_INFO, "dax option not supported");
+5 -1
fs/ext4/super.c
··· 1664 1664 } 1665 1665 sbi->s_jquota_fmt = m->mount_opt; 1666 1666 #endif 1667 - #ifndef CONFIG_FS_DAX 1668 1667 } else if (token == Opt_dax) { 1668 + #ifdef CONFIG_FS_DAX 1669 + ext4_msg(sb, KERN_WARNING, 1670 + "DAX enabled. Warning: EXPERIMENTAL, use at your own risk"); 1671 + sbi->s_mount_opt |= m->mount_opt; 1672 + #else 1669 1673 ext4_msg(sb, KERN_INFO, "dax option not supported"); 1670 1674 return -1; 1671 1675 #endif
+2
include/linux/blkdev.h
··· 794 794 extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, 795 795 struct scsi_ioctl_command __user *); 796 796 797 + extern int blk_queue_enter(struct request_queue *q, gfp_t gfp); 798 + extern void blk_queue_exit(struct request_queue *q); 797 799 extern void blk_start_queue(struct request_queue *q); 798 800 extern void blk_stop_queue(struct request_queue *q); 799 801 extern void blk_sync_queue(struct request_queue *q);
+4 -4
mm/memory.c
··· 3015 3015 } else { 3016 3016 /* 3017 3017 * The fault handler has no page to lock, so it holds 3018 - * i_mmap_lock for write to protect against truncate. 3018 + * i_mmap_lock for read to protect against truncate. 3019 3019 */ 3020 - i_mmap_unlock_write(vma->vm_file->f_mapping); 3020 + i_mmap_unlock_read(vma->vm_file->f_mapping); 3021 3021 } 3022 3022 goto uncharge_out; 3023 3023 } ··· 3031 3031 } else { 3032 3032 /* 3033 3033 * The fault handler has no page to lock, so it holds 3034 - * i_mmap_lock for write to protect against truncate. 3034 + * i_mmap_lock for read to protect against truncate. 3035 3035 */ 3036 - i_mmap_unlock_write(vma->vm_file->f_mapping); 3036 + i_mmap_unlock_read(vma->vm_file->f_mapping); 3037 3037 } 3038 3038 return ret; 3039 3039 uncharge_out: