summaryrefslogtreecommitdiffstats
path: root/kernel/acct.c
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2014-04-19 14:44:49 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2014-08-07 14:40:07 -0400
commitecfdb33d1fbc7e6e095ba24dac2930208494e734 (patch)
tree3e650fbb7ccc290fc4094dd420cdef3ddd966c9c /kernel/acct.c
parent82df9c8bebeff610705f30315f3903cbcb3aa58b (diff)
downloadop-kernel-dev-ecfdb33d1fbc7e6e095ba24dac2930208494e734.zip
op-kernel-dev-ecfdb33d1fbc7e6e095ba24dac2930208494e734.tar.gz
acct: encode_comp_t(0) is 0, fortunately...
There was an amusing bogosity in ac_rw calculation - it tried to do encode_comp_t(encode_comp_t(0) / 1024). Seeing that comp_t is a 3-bit exponent + 13-bit mantissa... it's a good thing that 0 is represented by all-bits-clear. The history of that one is interesting - it was introduced in 2.1.68pre1, when acct.c had been reworked and moved to separate file. Two months later (2.1.86) somebody has noticed that the sucker won't compile - there was no task_struct::io_usage. At which point the ac_io calculation had changed from encode_comp_t(current->io_usage) to encode_comp_t(0) and the bug in the next line (absolutely real back then, had it ever managed to compile) become a harmless bogosity. Looks like nobody has ever noticed until now. Anyway, let's bury that idiocy now that it got noticed. 17 years is long enough... Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'kernel/acct.c')
-rw-r--r--kernel/acct.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/kernel/acct.c b/kernel/acct.c
index a1844f1..807ebc5 100644
--- a/kernel/acct.c
+++ b/kernel/acct.c
@@ -531,9 +531,6 @@ static void do_acct_process(struct bsd_acct_struct *acct,
ac.ac_majflt = encode_comp_t(pacct->ac_majflt);
ac.ac_exitcode = pacct->ac_exitcode;
spin_unlock_irq(&current->sighand->siglock);
- ac.ac_io = encode_comp_t(0 /* current->io_usage */); /* %% */
- ac.ac_rw = encode_comp_t(ac.ac_io / 1024);
- ac.ac_swaps = encode_comp_t(0);
/*
* Get freeze protection. If the fs is frozen, just skip the write
OpenPOWER on IntegriCloud