[PATCH] Allow disabling drop_caches logging immediately

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Currently, echoing 4 to drop_caches disables logging for subsequent
operations, not the current operation, even if the write is combined
(echo 7 ...). This patch takes bit 2 into account before logging, so
that logging can be disabled concurrently with other operations.

This doesn't change the behaviour for existing scenarios encountered
in the wild.

Signed-off-by: Stephen Kitt <steve@xxxxxxx>
---
 fs/drop_caches.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/drop_caches.c b/fs/drop_caches.c
index d31b6c72b476..2562d6285ce4 100644
--- a/fs/drop_caches.c
+++ b/fs/drop_caches.c
@@ -65,12 +65,12 @@ int drop_caches_sysctl_handler(struct ctl_table *table, int write,
 			drop_slab();
 			count_vm_event(DROP_SLAB);
 		}
+		stfu |= sysctl_drop_caches & 4;
 		if (!stfu) {
 			pr_info("%s (%d): drop_caches: %d\n",
 				current->comm, task_pid_nr(current),
 				sysctl_drop_caches);
 		}
-		stfu |= sysctl_drop_caches & 4;
 	}
 	return 0;
 }
-- 
2.20.1




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux