Skip to content

Commit

Permalink
Merge branch 'akpm' (patches from Andrew)
Browse files Browse the repository at this point in the history
Merge misc fixes from Andrew Morton:
 "13 fixes"

* emailed patches from Andrew Morton <[email protected]>:
  mm: add missing __PAGETABLE_{PUD,PMD}_FOLDED defines
  mm: page_alloc: revert inadvertent !__GFP_FS retry behavior change
  kernel/sys.c: fix UNAME26 for 4.0
  mm: memcontrol: use "max" instead of "infinity" in control knobs
  zram: use proper type to update max_used_pages
  drivers/rtc/rtc-ds1685.c: fix conditional in ds1685_rtc_sysfs_time_regs_{show,store}
  nilfs2: fix potential memory overrun on inode
  scripts/gdb: add empty package initialization script
  rtc: ds1685: remove superfluous checks for out-of-range u8 values
  rtc: ds1685: fix ds1685_rtc_alarm_irq_enable build error
  memcg: fix low limit calculation
  mm/nommu: fix memory leak
  ocfs2: update web page + git tree in documentation
  • Loading branch information
torvalds committed Feb 28, 2015
2 parents 895c8b7 + c07af4f commit e973894
Show file tree
Hide file tree
Showing 18 changed files with 90 additions and 35 deletions.
4 changes: 2 additions & 2 deletions Documentation/cgroups/unified-hierarchy.txt
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,8 @@ supported and the interface files "release_agent" and
be understood as an underflow into the highest possible value, -2 or
-10M etc. do not work, so it's not consistent.

memory.low, memory.high, and memory.max will use the string
"infinity" to indicate and set the highest possible value.
memory.low, memory.high, and memory.max will use the string "max" to
indicate and set the highest possible value.

5. Planned Changes

Expand Down
4 changes: 2 additions & 2 deletions Documentation/filesystems/dlmfs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ system.

dlmfs is built with OCFS2 as it requires most of its infrastructure.

Project web page: http://oss.oracle.com/projects/ocfs2
Tools web page: http://oss.oracle.com/projects/ocfs2-tools
Project web page: http://ocfs2.wiki.kernel.org
Tools web page: https://github.com/markfasheh/ocfs2-tools
OCFS2 mailing lists: http://oss.oracle.com/projects/ocfs2/mailman/

All code copyright 2005 Oracle except when otherwise noted.
Expand Down
4 changes: 2 additions & 2 deletions Documentation/filesystems/ocfs2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ also make it attractive for non-clustered use.
You'll want to install the ocfs2-tools package in order to at least
get "mount.ocfs2" and "ocfs2_hb_ctl".

Project web page: http://oss.oracle.com/projects/ocfs2
Tools web page: http://oss.oracle.com/projects/ocfs2-tools
Project web page: http://ocfs2.wiki.kernel.org
Tools git tree: https://github.com/markfasheh/ocfs2-tools
OCFS2 mailing lists: http://oss.oracle.com/projects/ocfs2/mailman/

All code copyright 2005 Oracle except when otherwise noted.
Expand Down
3 changes: 1 addition & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -7213,8 +7213,7 @@ ORACLE CLUSTER FILESYSTEM 2 (OCFS2)
M: Mark Fasheh <[email protected]>
M: Joel Becker <[email protected]>
L: [email protected] (moderated for non-subscribers)
W: http://oss.oracle.com/projects/ocfs2/
T: git git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2.git
W: http://ocfs2.wiki.kernel.org
S: Supported
F: Documentation/filesystems/ocfs2.txt
F: Documentation/filesystems/dlmfs.txt
Expand Down
2 changes: 2 additions & 0 deletions arch/frv/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,12 +123,14 @@ extern unsigned long empty_zero_page;
#define PGDIR_MASK (~(PGDIR_SIZE - 1))
#define PTRS_PER_PGD 64

#define __PAGETABLE_PUD_FOLDED
#define PUD_SHIFT 26
#define PTRS_PER_PUD 1
#define PUD_SIZE (1UL << PUD_SHIFT)
#define PUD_MASK (~(PUD_SIZE - 1))
#define PUE_SIZE 256

#define __PAGETABLE_PMD_FOLDED
#define PMD_SHIFT 26
#define PMD_SIZE (1UL << PMD_SHIFT)
#define PMD_MASK (~(PMD_SIZE - 1))
Expand Down
1 change: 1 addition & 0 deletions arch/m32r/include/asm/pgtable-2level.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* the M32R is two-level, so we don't really have any
* PMD directory physically.
*/
#define __PAGETABLE_PMD_FOLDED
#define PMD_SHIFT 22
#define PTRS_PER_PMD 1

Expand Down
2 changes: 2 additions & 0 deletions arch/m68k/include/asm/pgtable_mm.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,12 @@
*/
#ifdef CONFIG_SUN3
#define PTRS_PER_PTE 16
#define __PAGETABLE_PMD_FOLDED
#define PTRS_PER_PMD 1
#define PTRS_PER_PGD 2048
#elif defined(CONFIG_COLDFIRE)
#define PTRS_PER_PTE 512
#define __PAGETABLE_PMD_FOLDED
#define PTRS_PER_PMD 1
#define PTRS_PER_PGD 1024
#else
Expand Down
2 changes: 2 additions & 0 deletions arch/mn10300/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ extern void paging_init(void);
#define PGDIR_SHIFT 22
#define PTRS_PER_PGD 1024
#define PTRS_PER_PUD 1 /* we don't really have any PUD physically */
#define __PAGETABLE_PUD_FOLDED
#define PTRS_PER_PMD 1 /* we don't really have any PMD physically */
#define __PAGETABLE_PMD_FOLDED
#define PTRS_PER_PTE 1024

#define PGD_SIZE PAGE_SIZE
Expand Down
1 change: 1 addition & 0 deletions arch/parisc/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ extern void purge_tlb_entries(struct mm_struct *, unsigned long);
#if PT_NLEVELS == 3
#define BITS_PER_PMD (PAGE_SHIFT + PMD_ORDER - BITS_PER_PMD_ENTRY)
#else
#define __PAGETABLE_PMD_FOLDED
#define BITS_PER_PMD 0
#endif
#define PTRS_PER_PMD (1UL << BITS_PER_PMD)
Expand Down
2 changes: 2 additions & 0 deletions arch/s390/include/asm/pgtable.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,9 @@ extern unsigned long zero_page_mask;
*/
#define PTRS_PER_PTE 256
#ifndef CONFIG_64BIT
#define __PAGETABLE_PUD_FOLDED
#define PTRS_PER_PMD 1
#define __PAGETABLE_PMD_FOLDED
#define PTRS_PER_PUD 1
#else /* CONFIG_64BIT */
#define PTRS_PER_PMD 2048
Expand Down
2 changes: 1 addition & 1 deletion drivers/block/zram/zram_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,
static inline void update_used_max(struct zram *zram,
const unsigned long pages)
{
int old_max, cur_max;
unsigned long old_max, cur_max;

old_max = atomic_long_read(&zram->stats.max_used_pages);

Expand Down
18 changes: 8 additions & 10 deletions drivers/rtc/rtc-ds1685.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,21 +399,21 @@ ds1685_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm)
* of this RTC chip. We check for it anyways in case support is
* added in the future.
*/
if (unlikely((seconds >= 0xc0) && (seconds <= 0xff)))
if (unlikely(seconds >= 0xc0))
alrm->time.tm_sec = -1;
else
alrm->time.tm_sec = ds1685_rtc_bcd2bin(rtc, seconds,
RTC_SECS_BCD_MASK,
RTC_SECS_BIN_MASK);

if (unlikely((minutes >= 0xc0) && (minutes <= 0xff)))
if (unlikely(minutes >= 0xc0))
alrm->time.tm_min = -1;
else
alrm->time.tm_min = ds1685_rtc_bcd2bin(rtc, minutes,
RTC_MINS_BCD_MASK,
RTC_MINS_BIN_MASK);

if (unlikely((hours >= 0xc0) && (hours <= 0xff)))
if (unlikely(hours >= 0xc0))
alrm->time.tm_hour = -1;
else
alrm->time.tm_hour = ds1685_rtc_bcd2bin(rtc, hours,
Expand Down Expand Up @@ -472,13 +472,13 @@ ds1685_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
* field, and we only support four fields. We put the support
* here anyways for the future.
*/
if (unlikely((seconds >= 0xc0) && (seconds <= 0xff)))
if (unlikely(seconds >= 0xc0))
seconds = 0xff;

if (unlikely((minutes >= 0xc0) && (minutes <= 0xff)))
if (unlikely(minutes >= 0xc0))
minutes = 0xff;

if (unlikely((hours >= 0xc0) && (hours <= 0xff)))
if (unlikely(hours >= 0xc0))
hours = 0xff;

alrm->time.tm_mon = -1;
Expand Down Expand Up @@ -528,7 +528,6 @@ ds1685_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm)
/* ----------------------------------------------------------------------- */
/* /dev/rtcX Interface functions */

#ifdef CONFIG_RTC_INTF_DEV
/**
* ds1685_rtc_alarm_irq_enable - replaces ioctl() RTC_AIE on/off.
* @dev: pointer to device structure.
Expand Down Expand Up @@ -557,7 +556,6 @@ ds1685_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled)

return 0;
}
#endif
/* ----------------------------------------------------------------------- */


Expand Down Expand Up @@ -1612,7 +1610,7 @@ ds1685_rtc_sysfs_time_regs_show(struct device *dev,
ds1685_rtc_sysfs_time_regs_lookup(attr->attr.name, false);

/* Make sure we actually matched something. */
if (!bcd_reg_info && !bin_reg_info)
if (!bcd_reg_info || !bin_reg_info)
return -EINVAL;

/* bcd_reg_info->reg == bin_reg_info->reg. */
Expand Down Expand Up @@ -1650,7 +1648,7 @@ ds1685_rtc_sysfs_time_regs_store(struct device *dev,
return -EINVAL;

/* Make sure we actually matched something. */
if (!bcd_reg_info && !bin_reg_info)
if (!bcd_reg_info || !bin_reg_info)
return -EINVAL;

/* Check for a valid range. */
Expand Down
47 changes: 44 additions & 3 deletions fs/nilfs2/btree.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#include "alloc.h"
#include "dat.h"

static void __nilfs_btree_init(struct nilfs_bmap *bmap);

static struct nilfs_btree_path *nilfs_btree_alloc_path(void)
{
struct nilfs_btree_path *path;
Expand Down Expand Up @@ -368,6 +370,34 @@ static int nilfs_btree_node_broken(const struct nilfs_btree_node *node,
return ret;
}

/**
* nilfs_btree_root_broken - verify consistency of btree root node
* @node: btree root node to be examined
* @ino: inode number
*
* Return Value: If node is broken, 1 is returned. Otherwise, 0 is returned.
*/
static int nilfs_btree_root_broken(const struct nilfs_btree_node *node,
unsigned long ino)
{
int level, flags, nchildren;
int ret = 0;

level = nilfs_btree_node_get_level(node);
flags = nilfs_btree_node_get_flags(node);
nchildren = nilfs_btree_node_get_nchildren(node);

if (unlikely(level < NILFS_BTREE_LEVEL_NODE_MIN ||
level > NILFS_BTREE_LEVEL_MAX ||
nchildren < 0 ||
nchildren > NILFS_BTREE_ROOT_NCHILDREN_MAX)) {
pr_crit("NILFS: bad btree root (inode number=%lu): level = %d, flags = 0x%x, nchildren = %d\n",
ino, level, flags, nchildren);
ret = 1;
}
return ret;
}

int nilfs_btree_broken_node_block(struct buffer_head *bh)
{
int ret;
Expand Down Expand Up @@ -1713,7 +1743,7 @@ nilfs_btree_commit_convert_and_insert(struct nilfs_bmap *btree,

/* convert and insert */
dat = NILFS_BMAP_USE_VBN(btree) ? nilfs_bmap_get_dat(btree) : NULL;
nilfs_btree_init(btree);
__nilfs_btree_init(btree);
if (nreq != NULL) {
nilfs_bmap_commit_alloc_ptr(btree, dreq, dat);
nilfs_bmap_commit_alloc_ptr(btree, nreq, dat);
Expand Down Expand Up @@ -2294,12 +2324,23 @@ static const struct nilfs_bmap_operations nilfs_btree_ops_gc = {
.bop_gather_data = NULL,
};

int nilfs_btree_init(struct nilfs_bmap *bmap)
static void __nilfs_btree_init(struct nilfs_bmap *bmap)
{
bmap->b_ops = &nilfs_btree_ops;
bmap->b_nchildren_per_block =
NILFS_BTREE_NODE_NCHILDREN_MAX(nilfs_btree_node_size(bmap));
return 0;
}

int nilfs_btree_init(struct nilfs_bmap *bmap)
{
int ret = 0;

__nilfs_btree_init(bmap);

if (nilfs_btree_root_broken(nilfs_btree_get_root(bmap),
bmap->b_inode->i_ino))
ret = -EIO;
return ret;
}

void nilfs_btree_init_gc(struct nilfs_bmap *bmap)
Expand Down
3 changes: 2 additions & 1 deletion kernel/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,7 @@ DECLARE_RWSEM(uts_sem);
/*
* Work around broken programs that cannot handle "Linux 3.0".
* Instead we map 3.x to 2.6.40+x, so e.g. 3.0 would be 2.6.40
* And we map 4.x to 2.6.60+x, so 4.0 would be 2.6.60.
*/
static int override_release(char __user *release, size_t len)
{
Expand All @@ -1127,7 +1128,7 @@ static int override_release(char __user *release, size_t len)
break;
rest++;
}
v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40;
v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 60;
copy = clamp_t(size_t, len, 1, sizeof(buf));
copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
ret = copy_to_user(release, buf, copy + 1);
Expand Down
16 changes: 8 additions & 8 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -5247,7 +5247,7 @@ static int memory_low_show(struct seq_file *m, void *v)
unsigned long low = ACCESS_ONCE(memcg->low);

if (low == PAGE_COUNTER_MAX)
seq_puts(m, "infinity\n");
seq_puts(m, "max\n");
else
seq_printf(m, "%llu\n", (u64)low * PAGE_SIZE);

Expand All @@ -5262,7 +5262,7 @@ static ssize_t memory_low_write(struct kernfs_open_file *of,
int err;

buf = strstrip(buf);
err = page_counter_memparse(buf, "infinity", &low);
err = page_counter_memparse(buf, "max", &low);
if (err)
return err;

Expand All @@ -5277,7 +5277,7 @@ static int memory_high_show(struct seq_file *m, void *v)
unsigned long high = ACCESS_ONCE(memcg->high);

if (high == PAGE_COUNTER_MAX)
seq_puts(m, "infinity\n");
seq_puts(m, "max\n");
else
seq_printf(m, "%llu\n", (u64)high * PAGE_SIZE);

Expand All @@ -5292,7 +5292,7 @@ static ssize_t memory_high_write(struct kernfs_open_file *of,
int err;

buf = strstrip(buf);
err = page_counter_memparse(buf, "infinity", &high);
err = page_counter_memparse(buf, "max", &high);
if (err)
return err;

Expand All @@ -5307,7 +5307,7 @@ static int memory_max_show(struct seq_file *m, void *v)
unsigned long max = ACCESS_ONCE(memcg->memory.limit);

if (max == PAGE_COUNTER_MAX)
seq_puts(m, "infinity\n");
seq_puts(m, "max\n");
else
seq_printf(m, "%llu\n", (u64)max * PAGE_SIZE);

Expand All @@ -5322,7 +5322,7 @@ static ssize_t memory_max_write(struct kernfs_open_file *of,
int err;

buf = strstrip(buf);
err = page_counter_memparse(buf, "infinity", &max);
err = page_counter_memparse(buf, "max", &max);
if (err)
return err;

Expand Down Expand Up @@ -5426,7 +5426,7 @@ bool mem_cgroup_low(struct mem_cgroup *root, struct mem_cgroup *memcg)
if (memcg == root_mem_cgroup)
return false;

if (page_counter_read(&memcg->memory) > memcg->low)
if (page_counter_read(&memcg->memory) >= memcg->low)
return false;

while (memcg != root) {
Expand All @@ -5435,7 +5435,7 @@ bool mem_cgroup_low(struct mem_cgroup *root, struct mem_cgroup *memcg)
if (memcg == root_mem_cgroup)
break;

if (page_counter_read(&memcg->memory) > memcg->low)
if (page_counter_read(&memcg->memory) >= memcg->low)
return false;
}
return true;
Expand Down
4 changes: 1 addition & 3 deletions mm/nommu.c
Original file line number Diff line number Diff line change
Expand Up @@ -1213,11 +1213,9 @@ static int do_mmap_private(struct vm_area_struct *vma,
if (sysctl_nr_trim_pages && total - point >= sysctl_nr_trim_pages) {
total = point;
kdebug("try to alloc exact %lu pages", total);
base = alloc_pages_exact(len, GFP_KERNEL);
} else {
base = (void *)__get_free_pages(GFP_KERNEL, order);
}

base = alloc_pages_exact(total << PAGE_SHIFT, GFP_KERNEL);
if (!base)
goto enomem;

Expand Down
9 changes: 8 additions & 1 deletion mm/page_alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2353,8 +2353,15 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order,
if (ac->high_zoneidx < ZONE_NORMAL)
goto out;
/* The OOM killer does not compensate for light reclaim */
if (!(gfp_mask & __GFP_FS))
if (!(gfp_mask & __GFP_FS)) {
/*
* XXX: Page reclaim didn't yield anything,
* and the OOM killer can't be invoked, but
* keep looping as per should_alloc_retry().
*/
*did_some_progress = 1;
goto out;
}
/*
* GFP_THISNODE contains __GFP_NORETRY and we never hit this.
* Sanity check for bare calls of __GFP_THISNODE, not real OOM.
Expand Down
1 change: 1 addition & 0 deletions scripts/gdb/linux/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# nothing to do for the initialization of this package

0 comments on commit e973894

Please sign in to comment.