History

Merge branch 'akpm' (patches from Andrew)

Merge misc fixes from Andrew Morton: "13 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: 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

Linus Torvalds committed 11 years ago

Commit e9738942 parents 895c8b7 c07af4f18 files · +90 −35Browse files

Unified · Split

18 files
  1. Documentation/cgroups/unified-hierarchy.txt +2 −2
  2. Documentation/filesystems/dlmfs.txt +2 −2
  3. Documentation/filesystems/ocfs2.txt +2 −2
  4. MAINTAINERS +1 −2
  5. arch/frv/include/asm/pgtable.h +2 −0
  6. arch/m32r/include/asm/pgtable-2level.h +1 −0
  7. arch/m68k/include/asm/pgtable_mm.h +2 −0
  8. arch/mn10300/include/asm/pgtable.h +2 −0
  9. arch/parisc/include/asm/pgtable.h +1 −0
  10. arch/s390/include/asm/pgtable.h +2 −0
  11. drivers/block/zram/zram_drv.c +1 −1
  12. drivers/rtc/rtc-ds1685.c +8 −10
  13. fs/nilfs2/btree.c +44 −3
  14. kernel/sys.c +2 −1
  15. mm/memcontrol.c +8 −8
  16. mm/nommu.c +1 −3
  17. mm/page_alloc.c +8 −1
  18. scripts/gdb/linux/__init__.py +1 −0
Documentation/cgroups/unified-hierarchy.txt+2−2
@@ -404,8 +404,8 @@ supported and the interface files "release_agent" and · 403 unmodified lines
404404 be understood as an underflow into the highest possible value, -2 or
405405 -10M etc. do not work, so it's not consistent.
406406
407− memory.low, memory.high, and memory.max will use the string
408− "infinity" to indicate and set the highest possible value.
407+ memory.low, memory.high, and memory.max will use the string "max" to
408+ indicate and set the highest possible value.
409409
410410 5. Planned Changes
411411
Documentation/filesystems/dlmfs.txt+2−2
@@ -5,8 +5,8 @@ system. · 4 unmodified lines
55
66 dlmfs is built with OCFS2 as it requires most of its infrastructure.
77
8−Project web page: http://oss.oracle.com/projects/ocfs2
9−Tools web page: http://oss.oracle.com/projects/ocfs2-tools
8+Project web page: http://ocfs2.wiki.kernel.org
9+Tools web page: https://github.com/markfasheh/ocfs2-tools
1010 OCFS2 mailing lists: http://oss.oracle.com/projects/ocfs2/mailman/
1111
1212 All code copyright 2005 Oracle except when otherwise noted.
Documentation/filesystems/ocfs2.txt+2−2
@@ -8,8 +8,8 @@ also make it attractive for non-clustered use. · 7 unmodified lines
88 You'll want to install the ocfs2-tools package in order to at least
99 get "mount.ocfs2" and "ocfs2_hb_ctl".
1010
11−Project web page: http://oss.oracle.com/projects/ocfs2
12−Tools web page: http://oss.oracle.com/projects/ocfs2-tools
11+Project web page: http://ocfs2.wiki.kernel.org
12+Tools git tree: https://github.com/markfasheh/ocfs2-tools
1313 OCFS2 mailing lists: http://oss.oracle.com/projects/ocfs2/mailman/
1414
1515 All code copyright 2005 Oracle except when otherwise noted.
MAINTAINERS+1−2
@@ -7213,8 +7213,7 @@ ORACLE CLUSTER FILESYSTEM 2 (OCFS2) · 7212 unmodified lines
72137213 M: Mark Fasheh <mfasheh@suse.com>
72147214 M: Joel Becker <jlbec@evilplan.org>
72157215 L: ocfs2-devel@oss.oracle.com (moderated for non-subscribers)
7216−W: http://oss.oracle.com/projects/ocfs2/
7217−T: git git://git.kernel.org/pub/scm/linux/kernel/git/jlbec/ocfs2.git
7216+W: http://ocfs2.wiki.kernel.org
72187217 S: Supported
72197218 F: Documentation/filesystems/ocfs2.txt
72207219 F: Documentation/filesystems/dlmfs.txt
arch/frv/include/asm/pgtable.h+2−0
@@ -123,12 +123,14 @@ extern unsigned long empty_zero_page; · 122 unmodified lines
123123 #define PGDIR_MASK (~(PGDIR_SIZE - 1))
124124 #define PTRS_PER_PGD 64
125125
126+#define __PAGETABLE_PUD_FOLDED
126127 #define PUD_SHIFT 26
127128 #define PTRS_PER_PUD 1
128129 #define PUD_SIZE (1UL << PUD_SHIFT)
129130 #define PUD_MASK (~(PUD_SIZE - 1))
130131 #define PUE_SIZE 256
131132
133+#define __PAGETABLE_PMD_FOLDED
132134 #define PMD_SHIFT 26
133135 #define PMD_SIZE (1UL << PMD_SHIFT)
134136 #define PMD_MASK (~(PMD_SIZE - 1))
arch/m32r/include/asm/pgtable-2level.h+1−0
@@ -13,6 +13,7 @@ · 12 unmodified lines
1313 * the M32R is two-level, so we don't really have any
1414 * PMD directory physically.
1515 */
16+#define __PAGETABLE_PMD_FOLDED
1617 #define PMD_SHIFT 22
1718 #define PTRS_PER_PMD 1
1819
arch/m68k/include/asm/pgtable_mm.h+2−0
@@ -54,10 +54,12 @@ · 53 unmodified lines
5454 */
5555 #ifdef CONFIG_SUN3
5656 #define PTRS_PER_PTE 16
57+#define __PAGETABLE_PMD_FOLDED
5758 #define PTRS_PER_PMD 1
5859 #define PTRS_PER_PGD 2048
5960 #elif defined(CONFIG_COLDFIRE)
6061 #define PTRS_PER_PTE 512
62+#define __PAGETABLE_PMD_FOLDED
6163 #define PTRS_PER_PMD 1
6264 #define PTRS_PER_PGD 1024
6365 #else
arch/mn10300/include/asm/pgtable.h+2−0
@@ -56,7 +56,9 @@ extern void paging_init(void); · 55 unmodified lines
5656 #define PGDIR_SHIFT 22
5757 #define PTRS_PER_PGD 1024
5858 #define PTRS_PER_PUD 1 /* we don't really have any PUD physically */
59+#define __PAGETABLE_PUD_FOLDED
5960 #define PTRS_PER_PMD 1 /* we don't really have any PMD physically */
61+#define __PAGETABLE_PMD_FOLDED
6062 #define PTRS_PER_PTE 1024
6163
6264 #define PGD_SIZE PAGE_SIZE
arch/parisc/include/asm/pgtable.h+1−0
@@ -96,6 +96,7 @@ extern void purge_tlb_entries(struct mm_struct *, unsigned long); · 95 unmodified lines
9696 #if PT_NLEVELS == 3
9797 #define BITS_PER_PMD (PAGE_SHIFT + PMD_ORDER - BITS_PER_PMD_ENTRY)
9898 #else
99+#define __PAGETABLE_PMD_FOLDED
99100 #define BITS_PER_PMD 0
100101 #endif
101102 #define PTRS_PER_PMD (1UL << BITS_PER_PMD)
arch/s390/include/asm/pgtable.h+2−0
@@ -91,7 +91,9 @@ extern unsigned long zero_page_mask; · 90 unmodified lines
9191 */
9292 #define PTRS_PER_PTE 256
9393 #ifndef CONFIG_64BIT
94+#define __PAGETABLE_PUD_FOLDED
9495 #define PTRS_PER_PMD 1
96+#define __PAGETABLE_PMD_FOLDED
9597 #define PTRS_PER_PUD 1
9698 #else /* CONFIG_64BIT */
9799 #define PTRS_PER_PMD 2048
drivers/block/zram/zram_drv.c+1−1
@@ -528,7 +528,7 @@ out_cleanup: · 527 unmodified lines
528528 static inline void update_used_max(struct zram *zram,
529529 const unsigned long pages)
530530 {
531− int old_max, cur_max;
531+ unsigned long old_max, cur_max;
532532
533533 old_max = atomic_long_read(&zram->stats.max_used_pages);
534534
drivers/rtc/rtc-ds1685.c+8−10
@@ -399,21 +399,21 @@ ds1685_rtc_read_alarm(struct device *dev, struct rtc_wkalrm *alrm) · 398 unmodified lines
399399 * of this RTC chip. We check for it anyways in case support is
400400 * added in the future.
401401 */
402− if (unlikely((seconds >= 0xc0) && (seconds <= 0xff)))
402+ if (unlikely(seconds >= 0xc0))
403403 alrm->time.tm_sec = -1;
404404 else
405405 alrm->time.tm_sec = ds1685_rtc_bcd2bin(rtc, seconds,
406406 RTC_SECS_BCD_MASK,
407407 RTC_SECS_BIN_MASK);
408408
409− if (unlikely((minutes >= 0xc0) && (minutes <= 0xff)))
409+ if (unlikely(minutes >= 0xc0))
410410 alrm->time.tm_min = -1;
411411 else
412412 alrm->time.tm_min = ds1685_rtc_bcd2bin(rtc, minutes,
413413 RTC_MINS_BCD_MASK,
414414 RTC_MINS_BIN_MASK);
415415
416− if (unlikely((hours >= 0xc0) && (hours <= 0xff)))
416+ if (unlikely(hours >= 0xc0))
417417 alrm->time.tm_hour = -1;
418418 else
419419 alrm->time.tm_hour = ds1685_rtc_bcd2bin(rtc, hours,
@@ -472,13 +472,13 @@ ds1685_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) · 52 unmodified lines
472472 * field, and we only support four fields. We put the support
473473 * here anyways for the future.
474474 */
475− if (unlikely((seconds >= 0xc0) && (seconds <= 0xff)))
475+ if (unlikely(seconds >= 0xc0))
476476 seconds = 0xff;
477477
478− if (unlikely((minutes >= 0xc0) && (minutes <= 0xff)))
478+ if (unlikely(minutes >= 0xc0))
479479 minutes = 0xff;
480480
481− if (unlikely((hours >= 0xc0) && (hours <= 0xff)))
481+ if (unlikely(hours >= 0xc0))
482482 hours = 0xff;
483483
484484 alrm->time.tm_mon = -1;
@@ -528,7 +528,6 @@ ds1685_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alrm) · 43 unmodified lines
528528 /* ----------------------------------------------------------------------- */
529529 /* /dev/rtcX Interface functions */
530530
531−#ifdef CONFIG_RTC_INTF_DEV
532531 /**
533532 * ds1685_rtc_alarm_irq_enable - replaces ioctl() RTC_AIE on/off.
534533 * @dev: pointer to device structure.
@@ -557,7 +556,6 @@ ds1685_rtc_alarm_irq_enable(struct device *dev, unsigned int enabled) · 22 unmodified lines
557556
558557 return 0;
559558 }
560−#endif
561559 /* ----------------------------------------------------------------------- */
562560
563561
@@ -1612,7 +1610,7 @@ ds1685_rtc_sysfs_time_regs_show(struct device *dev, · 1048 unmodified lines
16121610 ds1685_rtc_sysfs_time_regs_lookup(attr->attr.name, false);
16131611
16141612 /* Make sure we actually matched something. */
1615− if (!bcd_reg_info && !bin_reg_info)
1613+ if (!bcd_reg_info || !bin_reg_info)
16161614 return -EINVAL;
16171615
16181616 /* bcd_reg_info->reg == bin_reg_info->reg. */
@@ -1650,7 +1648,7 @@ ds1685_rtc_sysfs_time_regs_store(struct device *dev, · 31 unmodified lines
16501648 return -EINVAL;
16511649
16521650 /* Make sure we actually matched something. */
1653− if (!bcd_reg_info && !bin_reg_info)
1651+ if (!bcd_reg_info || !bin_reg_info)
16541652 return -EINVAL;
16551653
16561654 /* Check for a valid range. */
fs/nilfs2/btree.c+44−3
@@ -31,6 +31,8 @@ · 30 unmodified lines
3131 #include "alloc.h"
3232 #include "dat.h"
3333
34+static void __nilfs_btree_init(struct nilfs_bmap *bmap);
35+
3436 static struct nilfs_btree_path *nilfs_btree_alloc_path(void)
3537 {
3638 struct nilfs_btree_path *path;
@@ -368,6 +370,34 @@ static int nilfs_btree_node_broken(const struct nilfs_btree_node *node, · 331 unmodified lines
368370 return ret;
369371 }
370372
373+/**
374+ * nilfs_btree_root_broken - verify consistency of btree root node
375+ * @node: btree root node to be examined
376+ * @ino: inode number
377+ *
378+ * Return Value: If node is broken, 1 is returned. Otherwise, 0 is returned.
379+ */
380+static int nilfs_btree_root_broken(const struct nilfs_btree_node *node,
381+ unsigned long ino)
382+{
383+ int level, flags, nchildren;
384+ int ret = 0;
385+
386+ level = nilfs_btree_node_get_level(node);
387+ flags = nilfs_btree_node_get_flags(node);
388+ nchildren = nilfs_btree_node_get_nchildren(node);
389+
390+ if (unlikely(level < NILFS_BTREE_LEVEL_NODE_MIN ||
391+ level > NILFS_BTREE_LEVEL_MAX ||
392+ nchildren < 0 ||
393+ nchildren > NILFS_BTREE_ROOT_NCHILDREN_MAX)) {
394+ pr_crit("NILFS: bad btree root (inode number=%lu): level = %d, flags = 0x%x, nchildren = %d\n",
395+ ino, level, flags, nchildren);
396+ ret = 1;
397+ }
398+ return ret;
399+}
400+
371401 int nilfs_btree_broken_node_block(struct buffer_head *bh)
372402 {
373403 int ret;
@@ -1713,7 +1743,7 @@ nilfs_btree_commit_convert_and_insert(struct nilfs_bmap *btree, · 1339 unmodified lines
17131743
17141744 /* convert and insert */
17151745 dat = NILFS_BMAP_USE_VBN(btree) ? nilfs_bmap_get_dat(btree) : NULL;
1716− nilfs_btree_init(btree);
1746+ __nilfs_btree_init(btree);
17171747 if (nreq != NULL) {
17181748 nilfs_bmap_commit_alloc_ptr(btree, dreq, dat);
17191749 nilfs_bmap_commit_alloc_ptr(btree, nreq, dat);
@@ -2294,12 +2324,23 @@ static const struct nilfs_bmap_operations nilfs_btree_ops_gc = { · 574 unmodified lines
22942324 .bop_gather_data = NULL,
22952325 };
22962326
2297−int nilfs_btree_init(struct nilfs_bmap *bmap)
2327+static void __nilfs_btree_init(struct nilfs_bmap *bmap)
22982328 {
22992329 bmap->b_ops = &nilfs_btree_ops;
23002330 bmap->b_nchildren_per_block =
23012331 NILFS_BTREE_NODE_NCHILDREN_MAX(nilfs_btree_node_size(bmap));
2302− return 0;
2332+}
2333+
2334+int nilfs_btree_init(struct nilfs_bmap *bmap)
2335+{
2336+ int ret = 0;
2337+
2338+ __nilfs_btree_init(bmap);
2339+
2340+ if (nilfs_btree_root_broken(nilfs_btree_get_root(bmap),
2341+ bmap->b_inode->i_ino))
2342+ ret = -EIO;
2343+ return ret;
23032344 }
23042345
23052346 void nilfs_btree_init_gc(struct nilfs_bmap *bmap)
kernel/sys.c+2−1
@@ -1108,6 +1108,7 @@ DECLARE_RWSEM(uts_sem); · 1107 unmodified lines
11081108 /*
11091109 * Work around broken programs that cannot handle "Linux 3.0".
11101110 * Instead we map 3.x to 2.6.40+x, so e.g. 3.0 would be 2.6.40
1111+ * And we map 4.x to 2.6.60+x, so 4.0 would be 2.6.60.
11111112 */
11121113 static int override_release(char __user *release, size_t len)
11131114 {
@@ -1127,7 +1128,7 @@ static int override_release(char __user *release, size_t len) · 13 unmodified lines
11271128 break;
11281129 rest++;
11291130 }
1130− v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 40;
1131+ v = ((LINUX_VERSION_CODE >> 8) & 0xff) + 60;
11311132 copy = clamp_t(size_t, len, 1, sizeof(buf));
11321133 copy = scnprintf(buf, copy, "2.6.%u%s", v, rest);
11331134 ret = copy_to_user(release, buf, copy + 1);
mm/memcontrol.c+8−8
@@ -5247,7 +5247,7 @@ static int memory_low_show(struct seq_file *m, void *v) · 5246 unmodified lines
52475247 unsigned long low = ACCESS_ONCE(memcg->low);
52485248
52495249 if (low == PAGE_COUNTER_MAX)
5250− seq_puts(m, "infinity\n");
5250+ seq_puts(m, "max\n");
52515251 else
52525252 seq_printf(m, "%llu\n", (u64)low * PAGE_SIZE);
52535253
@@ -5262,7 +5262,7 @@ static ssize_t memory_low_write(struct kernfs_open_file *of, · 8 unmodified lines
52625262 int err;
52635263
52645264 buf = strstrip(buf);
5265− err = page_counter_memparse(buf, "infinity", &low);
5265+ err = page_counter_memparse(buf, "max", &low);
52665266 if (err)
52675267 return err;
52685268
@@ -5277,7 +5277,7 @@ static int memory_high_show(struct seq_file *m, void *v) · 8 unmodified lines
52775277 unsigned long high = ACCESS_ONCE(memcg->high);
52785278
52795279 if (high == PAGE_COUNTER_MAX)
5280− seq_puts(m, "infinity\n");
5280+ seq_puts(m, "max\n");
52815281 else
52825282 seq_printf(m, "%llu\n", (u64)high * PAGE_SIZE);
52835283
@@ -5292,7 +5292,7 @@ static ssize_t memory_high_write(struct kernfs_open_file *of, · 8 unmodified lines
52925292 int err;
52935293
52945294 buf = strstrip(buf);
5295− err = page_counter_memparse(buf, "infinity", &high);
5295+ err = page_counter_memparse(buf, "max", &high);
52965296 if (err)
52975297 return err;
52985298
@@ -5307,7 +5307,7 @@ static int memory_max_show(struct seq_file *m, void *v) · 8 unmodified lines
53075307 unsigned long max = ACCESS_ONCE(memcg->memory.limit);
53085308
53095309 if (max == PAGE_COUNTER_MAX)
5310− seq_puts(m, "infinity\n");
5310+ seq_puts(m, "max\n");
53115311 else
53125312 seq_printf(m, "%llu\n", (u64)max * PAGE_SIZE);
53135313
@@ -5322,7 +5322,7 @@ static ssize_t memory_max_write(struct kernfs_open_file *of, · 8 unmodified lines
53225322 int err;
53235323
53245324 buf = strstrip(buf);
5325− err = page_counter_memparse(buf, "infinity", &max);
5325+ err = page_counter_memparse(buf, "max", &max);
53265326 if (err)
53275327 return err;
53285328
@@ -5426,7 +5426,7 @@ bool mem_cgroup_low(struct mem_cgroup *root, struct mem_cgroup *memcg) · 97 unmodified lines
54265426 if (memcg == root_mem_cgroup)
54275427 return false;
54285428
5429− if (page_counter_read(&memcg->memory) > memcg->low)
5429+ if (page_counter_read(&memcg->memory) >= memcg->low)
54305430 return false;
54315431
54325432 while (memcg != root) {
@@ -5435,7 +5435,7 @@ bool mem_cgroup_low(struct mem_cgroup *root, struct mem_cgroup *memcg) · 2 unmodified lines
54355435 if (memcg == root_mem_cgroup)
54365436 break;
54375437
5438− if (page_counter_read(&memcg->memory) > memcg->low)
5438+ if (page_counter_read(&memcg->memory) >= memcg->low)
54395439 return false;
54405440 }
54415441 return true;
mm/nommu.c+1−3
@@ -1213,11 +1213,9 @@ static int do_mmap_private(struct vm_area_struct *vma, · 1212 unmodified lines
12131213 if (sysctl_nr_trim_pages && total - point >= sysctl_nr_trim_pages) {
12141214 total = point;
12151215 kdebug("try to alloc exact %lu pages", total);
1216− base = alloc_pages_exact(len, GFP_KERNEL);
1217− } else {
1218− base = (void *)__get_free_pages(GFP_KERNEL, order);
12191216 }
12201217
1218+ base = alloc_pages_exact(total << PAGE_SHIFT, GFP_KERNEL);
12211219 if (!base)
12221220 goto enomem;
12231221
mm/page_alloc.c+8−1
@@ -2353,8 +2353,15 @@ __alloc_pages_may_oom(gfp_t gfp_mask, unsigned int order, · 2352 unmodified lines
23532353 if (ac->high_zoneidx < ZONE_NORMAL)
23542354 goto out;
23552355 /* The OOM killer does not compensate for light reclaim */
2356− if (!(gfp_mask & __GFP_FS))
2356+ if (!(gfp_mask & __GFP_FS)) {
2357+ /*
2358+ * XXX: Page reclaim didn't yield anything,
2359+ * and the OOM killer can't be invoked, but
2360+ * keep looping as per should_alloc_retry().
2361+ */
2362+ *did_some_progress = 1;
23572363 goto out;
2364+ }
23582365 /*
23592366 * GFP_THISNODE contains __GFP_NORETRY and we never hit this.
23602367 * Sanity check for bare calls of __GFP_THISNODE, not real OOM.
scripts/gdb/linux/__init__.py+1−0
@@ -0,0 +1 @@
1+# nothing to do for the initialization of this package