OpenCloudOS-Kernel/fs/gfs2
Ross Lagerwall 7881ef3f33 gfs2: Fix lru_count going negative
Under certain conditions, lru_count may drop below zero resulting in
a large amount of log spam like this:

vmscan: shrink_slab: gfs2_dump_glock+0x3b0/0x630 [gfs2] \
    negative objects to delete nr=-1

This happens as follows:
1) A glock is moved from lru_list to the dispose list and lru_count is
   decremented.
2) The dispose function calls cond_resched() and drops the lru lock.
3) Another thread takes the lru lock and tries to add the same glock to
   lru_list, checking if the glock is on an lru list.
4) It is on a list (actually the dispose list) and so it avoids
   incrementing lru_count.
5) The glock is moved to lru_list.
5) The original thread doesn't dispose it because it has been re-added
   to the lru list but the lru_count has still decreased by one.

Fix by checking if the LRU flag is set on the glock rather than checking
if the glock is on some list and rearrange the code so that the LRU flag
is added/removed precisely when the glock is added/removed from lru_list.

Signed-off-by: Ross Lagerwall <ross.lagerwall@citrix.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
2019-05-07 22:33:53 +02:00
..
Kconfig gfs2: Fix the crc32c dependency 2018-02-01 11:25:31 -07:00
Makefile License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
acl.c gfs2: using posix_acl_xattr_size instead of posix_acl_to_xattr 2018-07-24 20:02:11 +02:00
acl.h gfs2: Switch to generic xattr handlers 2016-05-12 22:28:05 -04:00
aops.c gfs2: Fix the gfs2_invalidatepage description 2018-12-11 17:50:35 +01:00
aops.h gfs2: iomap buffered write support 2018-07-02 16:27:17 +01:00
bmap.c Wimplicit-fallthrough patches for 5.2-rc1 2019-05-07 12:48:10 -07:00
bmap.h gfs2: Iomap cleanups and improvements 2018-06-04 07:56:51 -05:00
dentry.c gfs2: Lock holder cleanup 2016-06-27 09:47:09 -05:00
dir.c gfs2: Pass resource group to rgblk_free 2018-10-12 07:33:07 -05:00
dir.h GFS2: Make rename not save dirent location 2014-10-01 14:06:15 +01:00
export.c gfs2: Get rid of gfs2_ilookup 2016-06-27 09:47:08 -05:00
file.c iomap: wire up the iopoll method 2019-02-24 08:20:17 -07:00
gfs2.h
glock.c gfs2: Fix lru_count going negative 2019-05-07 22:33:53 +02:00
glock.h gfs: no need to check return value of debugfs_create functions 2019-01-23 12:30:34 +01:00
glops.c Revert "gfs2: read journal in large chunks to locate the head" 2019-02-14 09:52:51 -08:00
glops.h GFS2: update freeze code to use freeze/thaw_super on all nodes 2014-11-17 10:36:39 +00:00
incore.h gfs: no need to check return value of debugfs_create functions 2019-01-23 12:30:34 +01:00
inode.c gfs2: Get rid of potential double-freeing in gfs2_create_inode 2018-12-11 21:44:29 +01:00
inode.h gfs2: Fix an incorrect gfs2_assert() 2019-03-06 07:00:43 -07:00
lock_dlm.c gfs2: Use fs_* functions instead of pr_* function where we can 2018-10-05 11:16:54 -05:00
log.c Revert "gfs2: read journal in large chunks to locate the head" 2019-02-14 09:52:51 -08:00
log.h gfs2: Clean up gfs2_is_{ordered,writeback} 2018-12-11 17:50:35 +01:00
lops.c for-5.1/block-20190302 2019-03-08 14:12:17 -08:00
lops.h Revert "gfs2: read journal in large chunks to locate the head" 2019-02-14 09:52:51 -08:00
main.c gfs: no need to check return value of debugfs_create functions 2019-01-23 12:30:34 +01:00
meta_io.c block: allow bio_for_each_segment_all() to iterate over multi-page bvec 2019-02-15 08:40:11 -07:00
meta_io.h GFS2: Refactor gfs2_remove_from_journal 2016-05-06 11:27:27 -05:00
ops_fstype.c Revert "gfs2: read journal in large chunks to locate the head" 2019-02-14 09:52:51 -08:00
quota.c gfs2: Fix some minor typos 2018-10-12 07:31:21 -05:00
quota.h gfs2: Fix fallocate chunk size 2018-03-08 09:26:20 -07:00
recovery.c Revert "gfs2: read journal in large chunks to locate the head" 2019-02-14 09:52:51 -08:00
recovery.h Revert "gfs2: read journal in large chunks to locate the head" 2019-02-14 09:52:51 -08:00
rgrp.c gfs2: Fix loop in gfs2_rbm_find (v2) 2019-05-07 22:33:44 +02:00
rgrp.h gfs2: Dump nrpages for inodes and their glocks 2018-12-12 12:33:23 +01:00
super.c gfs2: switch to ->free_inode() 2019-05-01 22:43:24 -04:00
super.h GFS2: update freeze code to use freeze/thaw_super on all nodes 2014-11-17 10:36:39 +00:00
sys.c GFS2: Fix recovery issues for spectators 2018-07-25 00:06:24 +02:00
sys.h GFS2: dlm based recovery coordination 2012-01-11 09:23:05 +00:00
trace_gfs2.h gfs2: eliminate rs_inum and reduce the size of gfs2 inodes 2018-06-21 07:39:31 -05:00
trans.c gfs2: Remove vestigial bd_ops 2018-12-11 21:43:58 +01:00
trans.h gfs2: Eliminate redundant ip->i_rgd 2018-07-05 17:47:16 +02:00
util.c gfs2: slow the deluge of io error messages 2018-10-05 10:51:11 -05:00
util.h gfs2: Use fs_* functions instead of pr_* function where we can 2018-10-05 11:16:54 -05:00
xattr.c gfs2: Pass resource group to rgblk_free 2018-10-12 07:33:07 -05:00
xattr.h gfs2: Remove gfs2_xattr_acl_chmod 2015-12-06 21:25:17 -05:00