Commit 922c010c authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton:
 "22 fixes"

* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (22 commits)
  fs/proc/proc_sysctl.c: fix NULL pointer dereference in put_links
  fs: fs_parser: fix printk format warning
  checkpatch: add %pt as a valid vsprintf extension
  mm/migrate.c: add missing flush_dcache_page for non-mapped page migrate
  drivers/block/zram/zram_drv.c: fix idle/writeback string compare
  mm/page_isolation.c: fix a wrong flag in set_migratetype_isolate()
  mm/memory_hotplug.c: fix notification in offline error path
  ptrace: take into account saved_sigmask in PTRACE{GET,SET}SIGMASK
  fs/proc/kcore.c: make kcore_modules static
  include/linux/list.h: fix list_is_first() kernel-doc
  mm/debug.c: fix __dump_page when mapping->host is not set
  mm: mempolicy: make mbind() return -EIO when MPOL_MF_STRICT is specified
  include/linux/hugetlb.h: convert to use vm_fault_t
  iommu/io-pgtable-arm-v7s: request DMA32 memory, and improve debugging
  mm: add support for kmem caches in DMA32 zone
  ocfs2: fix inode bh swapping mixup in ocfs2_reflink_inodes_lock
  mm/hotplug: fix offline undo_isolate_page_range()
  fs/open.c: allow opening only regular files during execve()
  mailmap: add Changbin Du
  mm/debug.c: add a cast to u64 for atomic64_read()
  ...
parents f9007cc6 23da9588
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -224,3 +224,5 @@ Yakir Yang <kuankuan.y@gmail.com> <ykk@rock-chips.com>
Yusuke Goda <goda.yusuke@renesas.com>
Gustavo Padovan <gustavo@las.ic.unicamp.br>
Gustavo Padovan <padovan@profusion.mobi>
Changbin Du <changbin.du@intel.com> <changbin.du@intel.com>
Changbin Du <changbin.du@intel.com> <changbin.du@gmail.com>
+6 −26
Original line number Diff line number Diff line
@@ -290,18 +290,8 @@ static ssize_t idle_store(struct device *dev,
	struct zram *zram = dev_to_zram(dev);
	unsigned long nr_pages = zram->disksize >> PAGE_SHIFT;
	int index;
	char mode_buf[8];
	ssize_t sz;

	sz = strscpy(mode_buf, buf, sizeof(mode_buf));
	if (sz <= 0)
		return -EINVAL;

	/* ignore trailing new line */
	if (mode_buf[sz - 1] == '\n')
		mode_buf[sz - 1] = 0x00;

	if (strcmp(mode_buf, "all"))
	if (!sysfs_streq(buf, "all"))
		return -EINVAL;

	down_read(&zram->init_lock);
@@ -635,25 +625,15 @@ static ssize_t writeback_store(struct device *dev,
	struct bio bio;
	struct bio_vec bio_vec;
	struct page *page;
	ssize_t ret, sz;
	char mode_buf[8];
	int mode = -1;
	ssize_t ret;
	int mode;
	unsigned long blk_idx = 0;

	sz = strscpy(mode_buf, buf, sizeof(mode_buf));
	if (sz <= 0)
		return -EINVAL;

	/* ignore trailing newline */
	if (mode_buf[sz - 1] == '\n')
		mode_buf[sz - 1] = 0x00;

	if (!strcmp(mode_buf, "idle"))
	if (sysfs_streq(buf, "idle"))
		mode = IDLE_WRITEBACK;
	else if (!strcmp(mode_buf, "huge"))
	else if (sysfs_streq(buf, "huge"))
		mode = HUGE_WRITEBACK;

	if (mode == -1)
	else
		return -EINVAL;

	down_read(&zram->init_lock);
+15 −4
Original line number Diff line number Diff line
@@ -160,6 +160,14 @@

#define ARM_V7S_TCR_PD1			BIT(5)

#ifdef CONFIG_ZONE_DMA32
#define ARM_V7S_TABLE_GFP_DMA GFP_DMA32
#define ARM_V7S_TABLE_SLAB_FLAGS SLAB_CACHE_DMA32
#else
#define ARM_V7S_TABLE_GFP_DMA GFP_DMA
#define ARM_V7S_TABLE_SLAB_FLAGS SLAB_CACHE_DMA
#endif

typedef u32 arm_v7s_iopte;

static bool selftest_running;
@@ -197,13 +205,16 @@ static void *__arm_v7s_alloc_table(int lvl, gfp_t gfp,
	void *table = NULL;

	if (lvl == 1)
		table = (void *)__get_dma_pages(__GFP_ZERO, get_order(size));
		table = (void *)__get_free_pages(
			__GFP_ZERO | ARM_V7S_TABLE_GFP_DMA, get_order(size));
	else if (lvl == 2)
		table = kmem_cache_zalloc(data->l2_tables, gfp | GFP_DMA);
		table = kmem_cache_zalloc(data->l2_tables, gfp);
	phys = virt_to_phys(table);
	if (phys != (arm_v7s_iopte)phys)
	if (phys != (arm_v7s_iopte)phys) {
		/* Doesn't fit in PTE */
		dev_err(dev, "Page table does not fit in PTE: %pa", &phys);
		goto out_free;
	}
	if (table && !(cfg->quirks & IO_PGTABLE_QUIRK_NO_DMA)) {
		dma = dma_map_single(dev, table, size, DMA_TO_DEVICE);
		if (dma_mapping_error(dev, dma))
@@ -733,7 +744,7 @@ static struct io_pgtable *arm_v7s_alloc_pgtable(struct io_pgtable_cfg *cfg,
	data->l2_tables = kmem_cache_create("io-pgtable_armv7s_l2",
					    ARM_V7S_TABLE_SIZE(2),
					    ARM_V7S_TABLE_SIZE(2),
					    SLAB_CACHE_DMA, NULL);
					    ARM_V7S_TABLE_SLAB_FLAGS, NULL);
	if (!data->l2_tables)
		goto out_free_data;

+1 −1
Original line number Diff line number Diff line
@@ -410,7 +410,7 @@ bool fs_validate_description(const struct fs_parameter_description *desc)
			for (param = desc->specs; param->name; param++) {
				if (param->opt == e->opt &&
				    param->type != fs_param_is_enum) {
					pr_err("VALIDATE %s: e[%lu] enum val for %s\n",
					pr_err("VALIDATE %s: e[%tu] enum val for %s\n",
					       name, e - desc->enums, param->name);
					good = false;
				}
+24 −18
Original line number Diff line number Diff line
@@ -4719,22 +4719,23 @@ out:

/* Lock an inode and grab a bh pointing to the inode. */
int ocfs2_reflink_inodes_lock(struct inode *s_inode,
			      struct buffer_head **bh1,
			      struct buffer_head **bh_s,
			      struct inode *t_inode,
			      struct buffer_head **bh2)
			      struct buffer_head **bh_t)
{
	struct inode *inode1;
	struct inode *inode2;
	struct inode *inode1 = s_inode;
	struct inode *inode2 = t_inode;
	struct ocfs2_inode_info *oi1;
	struct ocfs2_inode_info *oi2;
	struct buffer_head *bh1 = NULL;
	struct buffer_head *bh2 = NULL;
	bool same_inode = (s_inode == t_inode);
	bool need_swap = (inode1->i_ino > inode2->i_ino);
	int status;

	/* First grab the VFS and rw locks. */
	lock_two_nondirectories(s_inode, t_inode);
	inode1 = s_inode;
	inode2 = t_inode;
	if (inode1->i_ino > inode2->i_ino)
	if (need_swap)
		swap(inode1, inode2);

	status = ocfs2_rw_lock(inode1, 1);
@@ -4757,17 +4758,13 @@ int ocfs2_reflink_inodes_lock(struct inode *s_inode,
	trace_ocfs2_double_lock((unsigned long long)oi1->ip_blkno,
				(unsigned long long)oi2->ip_blkno);

	if (*bh1)
		*bh1 = NULL;
	if (*bh2)
		*bh2 = NULL;

	/* We always want to lock the one with the lower lockid first. */
	if (oi1->ip_blkno > oi2->ip_blkno)
		mlog_errno(-ENOLCK);

	/* lock id1 */
	status = ocfs2_inode_lock_nested(inode1, bh1, 1, OI_LS_REFLINK_TARGET);
	status = ocfs2_inode_lock_nested(inode1, &bh1, 1,
					 OI_LS_REFLINK_TARGET);
	if (status < 0) {
		if (status != -ENOENT)
			mlog_errno(status);
@@ -4776,15 +4773,25 @@ int ocfs2_reflink_inodes_lock(struct inode *s_inode,

	/* lock id2 */
	if (!same_inode) {
		status = ocfs2_inode_lock_nested(inode2, bh2, 1,
		status = ocfs2_inode_lock_nested(inode2, &bh2, 1,
						 OI_LS_REFLINK_TARGET);
		if (status < 0) {
			if (status != -ENOENT)
				mlog_errno(status);
			goto out_cl1;
		}
	} else
		*bh2 = *bh1;
	} else {
		bh2 = bh1;
	}

	/*
	 * If we swapped inode order above, we have to swap the buffer heads
	 * before passing them back to the caller.
	 */
	if (need_swap)
		swap(bh1, bh2);
	*bh_s = bh1;
	*bh_t = bh2;

	trace_ocfs2_double_lock_end(
			(unsigned long long)oi1->ip_blkno,
@@ -4794,8 +4801,7 @@ int ocfs2_reflink_inodes_lock(struct inode *s_inode,

out_cl1:
	ocfs2_inode_unlock(inode1, 1);
	brelse(*bh1);
	*bh1 = NULL;
	brelse(bh1);
out_rw2:
	ocfs2_rw_unlock(inode2, 1);
out_i2:
Loading