]> git.pld-linux.org Git - packages/kernel.git/blame - kernel-small_fixes.patch
- xfs: don't eat ram on quotacheck
[packages/kernel.git] / kernel-small_fixes.patch
CommitLineData
08aa9d92 1--- linux-2.6.33/scripts/mod/modpost.c~ 2010-02-24 19:52:17.000000000 +0100
2+++ linux-2.6.33/scripts/mod/modpost.c 2010-03-07 14:26:47.242168558 +0100
3@@ -15,7 +15,8 @@
4 #include <stdio.h>
5 #include <ctype.h>
6 #include "modpost.h"
7-#include "../../include/generated/autoconf.h"
8+// PLD architectures don't use CONFIG_SYMBOL_PREFIX
9+//#include "../../include/generated/autoconf.h"
10 #include "../../include/linux/license.h"
11
12 /* Some toolchains use a `_' prefix for all user symbols. */
13
2136e199
AM
14--- linux-3.0/scripts/kconfig/lxdialog/check-lxdialog.sh~ 2011-07-22 04:17:23.000000000 +0200
15+++ linux-3.0/scripts/kconfig/lxdialog/check-lxdialog.sh 2011-08-25 21:26:04.799150642 +0200
16@@ -9,6 +9,12 @@
17 $cc -print-file-name=lib${lib}.${ext} | grep -q /
18 if [ $? -eq 0 ]; then
19 echo "-l${lib}"
20+ for libt in tinfow tinfo ; do
21+ $cc -print-file-name=lib${libt}.${ext} | grep -q /
22+ if [ $? -eq 0 ]; then
23+ echo "-l${libt}"
24+ fi
25+ done
26 exit
27 fi
28 done
746b5ec8 29
08da2677
AM
30From: Eric Sandeen <sandeen@redhat.com>
31Subject: [PATCH] xfs: don't wrap ID in xfs_dq_get_next_id
32Message-ID: <f52de68d-abe6-1960-c0ef-1d199346f689@redhat.com>
33Date: Fri, 16 Dec 2016 18:05:20 -0600
34
35The GETNEXTQOTA ioctl takes whatever ID is sent in,
36and looks for the next active quota for an user
37equal or higher to that ID.
38
39But if we are at the maximum ID and then ask for the "next"
40one, we may wrap back to zero. In this case, userspace
41may loop forever, because it will start querying again
42at zero.
43
44We'll fix this in userspace as well, but for the kernel,
45return -ENOENT if we ask for the next quota ID
46past UINT_MAX so the caller knows to stop.
47
48Signed-off-by: Eric Sandeen <sandeen@redhat.com>
49---
50
51diff --git a/fs/xfs/xfs_dquot.c b/fs/xfs/xfs_dquot.c
52index 7a30b8f..dbeddd9 100644
53--- a/fs/xfs/xfs_dquot.c
54+++ b/fs/xfs/xfs_dquot.c
55@@ -710,6 +710,10 @@
56 /* Simple advance */
57 next_id = *id + 1;
58
59+ /* If we'd wrap past the max ID, stop */
60+ if (next_id < *id)
61+ return -ENOENT;
62+
63 /* If new ID is within the current chunk, advancing it sufficed */
64 if (next_id % mp->m_quotainfo->qi_dqperchunk) {
65 *id = next_id;
66
53badc7f
AM
67From: Brian Foster <bfoster@redhat.com>
68Subject: [PATCH] xfs: prevent quotacheck from overloading inode lru
69
70Quotacheck runs at mount time in situations where quota accounting must
71be recalculated. In doing so, it uses bulkstat to visit every inode in
72the filesystem. Historically, every inode processed during quotacheck
73was released and immediately tagged for reclaim because quotacheck runs
74before the superblock is marked active by the VFS. In other words,
75the final iput() lead to an immediate ->destroy_inode() call, which
76allowed the XFS background reclaim worker to start reclaiming inodes.
77
78Commit 17c12bcd3 ("xfs: when replaying bmap operations, don't let
79unlinked inodes get reaped") marks the XFS superblock active sooner as
80part of the mount process to support caching inodes processed during log
81recovery. This occurs before quotacheck and thus means all inodes
82processed by quotacheck are inserted to the LRU on release. The
83s_umount lock is held until the mount has completed and thus prevents
84the shrinkers from operating on the sb. This means that quotacheck can
85excessively populate the inode LRU and lead to OOM conditions on systems
86without sufficient RAM.
87
88Update the quotacheck bulkstat handler to set XFS_IGET_DONTCACHE on
89inodes processed by quotacheck. This causes ->drop_inode() to return 1
90and in turn causes iput_final() to evict the inode. This preserves the
91original quotacheck behavior and prevents it from overloading the LRU
92and running out of memory.
93
94CC: stable@vger.kernel.org # v4.9
95Reported-by: Martin Svec <martin.svec@zoner.cz>
96Signed-off-by: Brian Foster <bfoster@redhat.com>
97---
98 fs/xfs/xfs_qm.c | 3 ++-
99 1 file changed, 2 insertions(+), 1 deletion(-)
100
101diff --git a/fs/xfs/xfs_qm.c b/fs/xfs/xfs_qm.c
102index 45e50ea..b669b12 100644
103--- a/fs/xfs/xfs_qm.c
104+++ b/fs/xfs/xfs_qm.c
105@@ -1177,7 +1177,8 @@ xfs_qm_dqusage_adjust(
106 * the case in all other instances. It's OK that we do this because
107 * quotacheck is done only at mount time.
108 */
109- error = xfs_iget(mp, NULL, ino, 0, XFS_ILOCK_EXCL, &ip);
110+ error = xfs_iget(mp, NULL, ino, XFS_IGET_DONTCACHE, XFS_ILOCK_EXCL,
111+ &ip);
112 if (error) {
113 *res = BULKSTAT_RV_NOTHING;
114 return error;
115--
1162.7.4
117
This page took 0.07489 seconds and 4 git commands to generate.