]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
net: Revert "fib_trie: use seq_file_net rather than seq->private"
authorSasha Levin <sasha.levin@oracle.com>
Wed, 4 Jun 2014 22:02:32 +0000 (18:02 -0400)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 Jun 2014 22:11:41 +0000 (15:11 -0700)
commitf830b0223cabfc614552a73dabff920859191f2e
tree37843d8a076c5dfab950fcc8910dd4138a617135
parentcef33c815a80bf1f3b3353e2ee8d9a617007c8aa
net: Revert "fib_trie: use seq_file_net rather than seq->private"

This reverts commit 30f38d2fdd79f13fc929489f7e6e517b4a4bfe63.

fib_triestat is surrounded by a big lie: while it claims that it's a
seq_file (fib_triestat_seq_open, fib_triestat_seq_show), it isn't:

static const struct file_operations fib_triestat_fops = {
        .owner  = THIS_MODULE,
        .open   = fib_triestat_seq_open,
        .read   = seq_read,
        .llseek = seq_lseek,
        .release = single_release_net,
};

Yes, fib_triestat is just a regular file.

A small detail (assuming CONFIG_NET_NS=y) is that while for seq_files
you could do seq_file_net() to get the net ptr, doing so for a regular
file would be wrong and would dereference an invalid pointer.

The fib_triestat lie claimed a victim, and trying to show the file would
be bad for the kernel. This patch just reverts the issue and fixes
fib_triestat, which still needs a rewrite to either be a seq_file or
stop claiming it is.

Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_trie.c