[Devel] [PATCH RHEL8 COMMIT] ms/unix: define and set show_fdinfo only if procfs is enabled

Konstantin Khorenko khorenko at virtuozzo.com
Wed Jun 2 19:48:01 MSK 2021


The commit is pushed to "branch-rh8-4.18.0-240.1.1.vz8.5.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh8-4.18.0-240.1.1.vz8.5.34
------>
commit 7c031fc7f258e903bfb59f93d51a5d5a8ca56b16
Author: Vasily Averin <vvs at virtuozzo.com>
Date:   Wed Jun 2 19:48:01 2021 +0300

    ms/unix: define and set show_fdinfo only if procfs is enabled
    
    Follow the pattern used with other *_show_fdinfo functions and only
    define unix_show_fdinfo and set it in proto_ops if CONFIG_PROCFS
    is set.
    
    mFixes: 3c32da19a858 ("unix: Show number of pending scm files of receive queue in fdinfo")
    Signed-off-by: Tobias Klauser <tklauser at distanz.ch>
    Reviewed-by: Kirill Tkhai <ktkhai at virtuozzo.com>
    Signed-off-by: David S. Miller <davem at davemloft.net>
    
    (cherry picked from ms commit 3a12500ed5dd ("unix: define and set show_fdinfo
    only if procfs is enabled"))
    
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
    
    +++
    unix: It's CONFIG_PROC_FS not CONFIG_PROCFS
    
    Fixes: 3a12500ed5dd ("unix: define and set show_fdinfo only if procfs is enabled")
    Signed-off-by: David S. Miller <davem at davemloft.net>
    
    (cherry picked from ms commit 5c05a164d441 ("unix: It's CONFIG_PROC_FS not
    CONFIG_PROCFS"))
    
    Signed-off-by: Vasily Averin <vvs at virtuozzo.com>
---
 net/unix/af_unix.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/unix/af_unix.c b/net/unix/af_unix.c
index 67648b61ce11..acd7985d1faa 100644
--- a/net/unix/af_unix.c
+++ b/net/unix/af_unix.c
@@ -673,6 +673,7 @@ static int unix_set_peek_off(struct sock *sk, int val)
 	return 0;
 }
 
+#ifdef CONFIG_PROC_FS
 static void unix_show_fdinfo(struct seq_file *m, struct socket *sock)
 {
 	struct sock *sk = sock->sk;
@@ -683,6 +684,9 @@ static void unix_show_fdinfo(struct seq_file *m, struct socket *sock)
 		seq_printf(m, "scm_fds: %u\n", READ_ONCE(u->scm_stat.nr_fds));
 	}
 }
+#else
+#define unix_show_fdinfo NULL
+#endif
 
 static const struct proto_ops unix_stream_ops = {
 	.family =	PF_UNIX,


More information about the Devel mailing list