lustre-devel-lustre.org archive mirror
 help / color / mirror / Atom feed
* [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020
@ 2021-04-25 20:08 James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 01/29] lnet: socklnd: use sockaddr instead of u32 addresses James Simmons
                   ` (28 more replies)
  0 siblings, 29 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

Update the Linux lustre client to the lastes OpenSFS tree as of
April 25, 2020. Only thing missing is the fake symlink which needs
more work to make it function with newer kernels.

Andreas Dilger (5):
  lustre: lmv: reduce struct lmv_obd size
  lustre: uapi: remove obsolete ioctls
  lnet: libcfs: fix setting of debug_path
  lustre: osc: fall back to vmalloc for large RPCs
  lustre: misc: limit CDEBUG console message frequency

Arshad Hussain (1):
  lustre: fallocate: Add punch mode to fallocate

Chris Horn (3):
  lnet: o2iblnd: Use REMOTE_DROPPED for ECONNREFUSED
  lnet: Use lr_hops for avoid_asym_router_failure
  lnet: Leverage peer aliveness more efficiently

Lai Siyao (2):
  lustre: mdc: set fid2path RPC interruptible
  lustre: mdt: mkdir should return -EEXIST if exists

Li Dongyang (2):
  lnet: o2iblnd: don't resend if there's no listener
  lnet: obi2lnd: don't try to reconnect if there's no listener

Mikhail Pershin (1):
  lustre: llite: do fallocate() size checks under lock

Mr NeilBrown (10):
  lnet: socklnd: use sockaddr instead of u32 addresses.
  lnet: allow creation of IPv6 socket.
  lnet: allow lnet_connect() to use IPv6 addresses
  lnet: handle possiblity of IPv6 being unavailable.
  lustre: include: remove references to Sun Trademark.
  lustre: lmv: don't include struct lu_qos_rr in client
  lustre: ldlm: discard l_lock from struct ldlm_lock.
  lustre: various: only use wake_up_all() on exclusive waitqs
  lnet: remove references to Sun Trademark.
  lustre: remove references to Sun Trademark.

Serguei Smirnov (2):
  lnet: socklnd: remove tcp bonding
  lnet: socklnd: replace route construct

Wang Shilong (2):
  lustre: readahead: limit over reservation
  lustre: clio: fix hang on urgent cached pages

Yang Sheng (1):
  lustre: uapi: add mdt_hash_name

 fs/lustre/fid/fid_internal.h               |    1 -
 fs/lustre/fid/fid_lib.c                    |    1 -
 fs/lustre/fid/fid_request.c                |    1 -
 fs/lustre/fid/lproc_fid.c                  |    1 -
 fs/lustre/fld/fld_cache.c                  |    1 -
 fs/lustre/fld/fld_internal.h               |    1 -
 fs/lustre/fld/fld_request.c                |    1 -
 fs/lustre/fld/lproc_fld.c                  |    1 -
 fs/lustre/include/cl_object.h              |   18 +-
 fs/lustre/include/lprocfs_status.h         |    1 -
 fs/lustre/include/lu_object.h              |   31 +-
 fs/lustre/include/lustre_acl.h             |    1 -
 fs/lustre/include/lustre_disk.h            |    1 -
 fs/lustre/include/lustre_dlm.h             |   18 +-
 fs/lustre/include/lustre_export.h          |    1 -
 fs/lustre/include/lustre_fid.h             |    1 -
 fs/lustre/include/lustre_fld.h             |    1 -
 fs/lustre/include/lustre_ha.h              |    1 -
 fs/lustre/include/lustre_handles.h         |    2 -
 fs/lustre/include/lustre_import.h          |    2 -
 fs/lustre/include/lustre_intent.h          |    1 -
 fs/lustre/include/lustre_lib.h             |    1 -
 fs/lustre/include/lustre_log.h             |    1 -
 fs/lustre/include/lustre_mdc.h             |    1 -
 fs/lustre/include/lustre_net.h             |    5 +-
 fs/lustre/include/lustre_osc.h             |   11 +-
 fs/lustre/include/lustre_req_layout.h      |    1 -
 fs/lustre/include/lustre_sec.h             |    1 -
 fs/lustre/include/obd.h                    |    1 -
 fs/lustre/include/obd_cksum.h              |    1 -
 fs/lustre/include/obd_class.h              |    1 -
 fs/lustre/include/obd_support.h            |    1 -
 fs/lustre/include/obd_target.h             |    1 -
 fs/lustre/ldlm/l_lock.c                    |   28 +-
 fs/lustre/ldlm/ldlm_extent.c               |    1 -
 fs/lustre/ldlm/ldlm_flock.c                |    1 -
 fs/lustre/ldlm/ldlm_inodebits.c            |    1 -
 fs/lustre/ldlm/ldlm_internal.h             |    1 -
 fs/lustre/ldlm/ldlm_lib.c                  |    1 -
 fs/lustre/ldlm/ldlm_lock.c                 |   35 +-
 fs/lustre/ldlm/ldlm_lockd.c                |   23 +-
 fs/lustre/ldlm/ldlm_plain.c                |    1 -
 fs/lustre/ldlm/ldlm_pool.c                 |    1 -
 fs/lustre/ldlm/ldlm_request.c              |    1 -
 fs/lustre/ldlm/ldlm_resource.c             |   13 +-
 fs/lustre/llite/acl.c                      |    1 -
 fs/lustre/llite/dcache.c                   |    1 -
 fs/lustre/llite/dir.c                      |   15 +-
 fs/lustre/llite/file.c                     |   94 ++-
 fs/lustre/llite/glimpse.c                  |    1 -
 fs/lustre/llite/lcommon_cl.c               |    1 -
 fs/lustre/llite/lcommon_misc.c             |    1 -
 fs/lustre/llite/llite_internal.h           |    1 -
 fs/lustre/llite/llite_lib.c                |    3 +-
 fs/lustre/llite/llite_mmap.c               |    1 -
 fs/lustre/llite/llite_nfs.c                |    1 -
 fs/lustre/llite/lproc_llite.c              |   11 +-
 fs/lustre/llite/namei.c                    |    1 -
 fs/lustre/llite/pcc.c                      |    2 +-
 fs/lustre/llite/rw.c                       |   40 +-
 fs/lustre/llite/rw26.c                     |    1 -
 fs/lustre/llite/statahead.c                |    1 -
 fs/lustre/llite/super25.c                  |    1 -
 fs/lustre/llite/symlink.c                  |    1 -
 fs/lustre/llite/vvp_dev.c                  |    1 -
 fs/lustre/llite/vvp_internal.h             |    1 -
 fs/lustre/llite/vvp_io.c                   |   35 +-
 fs/lustre/llite/vvp_object.c               |    1 -
 fs/lustre/llite/vvp_page.c                 |    1 -
 fs/lustre/llite/xattr.c                    |    1 -
 fs/lustre/lmv/lmv_fld.c                    |    1 -
 fs/lustre/lmv/lmv_intent.c                 |    1 -
 fs/lustre/lmv/lmv_internal.h               |    1 -
 fs/lustre/lmv/lmv_obd.c                    |    1 -
 fs/lustre/lmv/lproc_lmv.c                  |    1 -
 fs/lustre/lov/lov_cl_internal.h            |    2 -
 fs/lustre/lov/lov_dev.c                    |    1 -
 fs/lustre/lov/lov_ea.c                     |    1 -
 fs/lustre/lov/lov_internal.h               |    1 -
 fs/lustre/lov/lov_io.c                     |   86 ++-
 fs/lustre/lov/lov_lock.c                   |    1 -
 fs/lustre/lov/lov_merge.c                  |    1 -
 fs/lustre/lov/lov_obd.c                    |   11 +-
 fs/lustre/lov/lov_object.c                 |    1 -
 fs/lustre/lov/lov_offset.c                 |    1 -
 fs/lustre/lov/lov_pack.c                   |    1 -
 fs/lustre/lov/lov_page.c                   |    1 -
 fs/lustre/lov/lov_pool.c                   |    1 -
 fs/lustre/lov/lov_request.c                |    1 -
 fs/lustre/lov/lovsub_dev.c                 |    1 -
 fs/lustre/lov/lovsub_object.c              |    1 -
 fs/lustre/lov/lproc_lov.c                  |    1 -
 fs/lustre/mdc/lproc_mdc.c                  |    1 -
 fs/lustre/mdc/mdc_changelog.c              |    8 +-
 fs/lustre/mdc/mdc_dev.c                    |   13 +-
 fs/lustre/mdc/mdc_internal.h               |    1 -
 fs/lustre/mdc/mdc_lib.c                    |    6 +-
 fs/lustre/mdc/mdc_locks.c                  |    1 -
 fs/lustre/mdc/mdc_reint.c                  |    1 -
 fs/lustre/mdc/mdc_request.c                |   13 +-
 fs/lustre/mgc/lproc_mgc.c                  |    1 -
 fs/lustre/mgc/mgc_internal.h               |    1 -
 fs/lustre/mgc/mgc_request.c                |    6 +-
 fs/lustre/obdclass/cl_internal.h           |    1 -
 fs/lustre/obdclass/cl_io.c                 |   31 +-
 fs/lustre/obdclass/cl_lock.c               |    1 -
 fs/lustre/obdclass/cl_object.c             |    1 -
 fs/lustre/obdclass/cl_page.c               |    1 -
 fs/lustre/obdclass/class_obd.c             |    1 -
 fs/lustre/obdclass/genops.c                |    1 -
 fs/lustre/obdclass/kernelcomm.c            |    1 -
 fs/lustre/obdclass/llog.c                  |    1 -
 fs/lustre/obdclass/llog_cat.c              |    1 -
 fs/lustre/obdclass/llog_internal.h         |    1 -
 fs/lustre/obdclass/llog_obd.c              |    1 -
 fs/lustre/obdclass/llog_swab.c             |    1 -
 fs/lustre/obdclass/lprocfs_counters.c      |    1 -
 fs/lustre/obdclass/lprocfs_status.c        |    1 -
 fs/lustre/obdclass/lu_object.c             |    3 +-
 fs/lustre/obdclass/lu_ref.c                |    1 -
 fs/lustre/obdclass/lu_tgt_descs.c          |   16 +-
 fs/lustre/obdclass/lu_tgt_pool.c           |    2 -
 fs/lustre/obdclass/lustre_handles.c        |    1 -
 fs/lustre/obdclass/lustre_peer.c           |    1 -
 fs/lustre/obdclass/obd_config.c            |    1 -
 fs/lustre/obdclass/obd_mount.c             |    1 -
 fs/lustre/obdclass/obd_sysfs.c             |    1 -
 fs/lustre/obdclass/obdo.c                  |    1 -
 fs/lustre/obdclass/statfs_pack.c           |    1 -
 fs/lustre/obdecho/debug.c                  |    1 -
 fs/lustre/obdecho/echo_client.c            |    6 +-
 fs/lustre/obdecho/echo_internal.h          |    1 -
 fs/lustre/osc/lproc_osc.c                  |    1 -
 fs/lustre/osc/osc_cache.c                  |    1 -
 fs/lustre/osc/osc_dev.c                    |    1 -
 fs/lustre/osc/osc_internal.h               |    1 -
 fs/lustre/osc/osc_io.c                     |  132 ++--
 fs/lustre/osc/osc_lock.c                   |    1 -
 fs/lustre/osc/osc_object.c                 |    1 -
 fs/lustre/osc/osc_page.c                   |   45 +-
 fs/lustre/osc/osc_request.c                |   18 +-
 fs/lustre/ptlrpc/client.c                  |   44 +-
 fs/lustre/ptlrpc/connection.c              |    1 -
 fs/lustre/ptlrpc/events.c                  |   17 +-
 fs/lustre/ptlrpc/import.c                  |    1 -
 fs/lustre/ptlrpc/layout.c                  |    1 -
 fs/lustre/ptlrpc/llog_client.c             |    1 -
 fs/lustre/ptlrpc/llog_net.c                |    1 -
 fs/lustre/ptlrpc/lproc_ptlrpc.c            |    1 -
 fs/lustre/ptlrpc/niobuf.c                  |    1 -
 fs/lustre/ptlrpc/pack_generic.c            |    1 -
 fs/lustre/ptlrpc/pers.c                    |    1 -
 fs/lustre/ptlrpc/pinger.c                  |    1 -
 fs/lustre/ptlrpc/ptlrpc_internal.h         |    1 -
 fs/lustre/ptlrpc/ptlrpc_module.c           |    1 -
 fs/lustre/ptlrpc/ptlrpcd.c                 |    1 -
 fs/lustre/ptlrpc/recover.c                 |    1 -
 fs/lustre/ptlrpc/sec.c                     |    1 -
 fs/lustre/ptlrpc/sec_bulk.c                |    3 +-
 fs/lustre/ptlrpc/sec_config.c              |    1 -
 fs/lustre/ptlrpc/sec_gc.c                  |    1 -
 fs/lustre/ptlrpc/sec_lproc.c               |    1 -
 fs/lustre/ptlrpc/sec_null.c                |    1 -
 fs/lustre/ptlrpc/sec_plain.c               |    1 -
 fs/lustre/ptlrpc/service.c                 |    3 +-
 fs/lustre/ptlrpc/wiretest.c                |    1 -
 include/linux/libcfs/libcfs_debug.h        |    2 +-
 include/linux/lnet/lib-lnet.h              |   24 +-
 include/linux/lnet/lib-types.h             |    7 +-
 include/uapi/linux/lnet/libcfs_debug.h     |    1 -
 include/uapi/linux/lnet/libcfs_ioctl.h     |    1 -
 include/uapi/linux/lnet/lnet-dlc.h         |    5 +-
 include/uapi/linux/lnet/lnet-idl.h         |    1 -
 include/uapi/linux/lnet/socklnd.h          |    1 -
 include/uapi/linux/lustre/lustre_cfg.h     |    1 -
 include/uapi/linux/lustre/lustre_fiemap.h  |    1 -
 include/uapi/linux/lustre/lustre_idl.h     |    3 +-
 include/uapi/linux/lustre/lustre_ioctl.h   |   28 +-
 include/uapi/linux/lustre/lustre_param.h   |    1 -
 include/uapi/linux/lustre/lustre_user.h    |   13 +-
 net/lnet/klnds/o2iblnd/o2iblnd-idl.h       |    1 -
 net/lnet/klnds/o2iblnd/o2iblnd.c           |   21 +-
 net/lnet/klnds/o2iblnd/o2iblnd.h           |    3 -
 net/lnet/klnds/o2iblnd/o2iblnd_cb.c        |   41 +-
 net/lnet/klnds/o2iblnd/o2iblnd_modparams.c |    1 -
 net/lnet/klnds/socklnd/socklnd.c           | 1123 ++++++++--------------------
 net/lnet/klnds/socklnd/socklnd.h           |   53 +-
 net/lnet/klnds/socklnd/socklnd_cb.c        |  320 ++++----
 net/lnet/klnds/socklnd/socklnd_lib.c       |    8 +-
 net/lnet/klnds/socklnd/socklnd_proto.c     |   52 +-
 net/lnet/libcfs/debug.c                    |   18 +-
 net/lnet/lnet/acceptor.c                   |  115 ++-
 net/lnet/lnet/api-ni.c                     |   59 +-
 net/lnet/lnet/config.c                     |   59 +-
 net/lnet/lnet/lib-md.c                     |    1 -
 net/lnet/lnet/lib-me.c                     |    1 -
 net/lnet/lnet/lib-move.c                   |   38 +-
 net/lnet/lnet/lib-msg.c                    |    1 -
 net/lnet/lnet/lib-ptl.c                    |    1 -
 net/lnet/lnet/lib-socket.c                 |  113 ++-
 net/lnet/lnet/lo.c                         |    1 -
 net/lnet/lnet/module.c                     |    1 -
 net/lnet/lnet/nidstrings.c                 |    1 -
 net/lnet/lnet/peer.c                       |    3 +-
 net/lnet/lnet/router.c                     |   39 +-
 net/lnet/selftest/brw_test.c               |    1 -
 net/lnet/selftest/conctl.c                 |    1 -
 net/lnet/selftest/conrpc.c                 |    1 -
 net/lnet/selftest/conrpc.h                 |    1 -
 net/lnet/selftest/console.c                |    1 -
 net/lnet/selftest/console.h                |    1 -
 net/lnet/selftest/framework.c              |    1 -
 net/lnet/selftest/module.c                 |    1 -
 net/lnet/selftest/ping_test.c              |    1 -
 net/lnet/selftest/rpc.c                    |    1 -
 net/lnet/selftest/rpc.h                    |    1 -
 net/lnet/selftest/selftest.h               |    1 -
 net/lnet/selftest/timer.c                  |    1 -
 net/lnet/selftest/timer.h                  |    1 -
 219 files changed, 1369 insertions(+), 1787 deletions(-)

-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 01/29] lnet: socklnd: use sockaddr instead of u32 addresses.
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 02/29] lnet: allow creation of IPv6 socket James Simmons
                   ` (27 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Mr NeilBrown <neilb@suse.de>

LNet/socklnd often uses u32 to hold an ipv4 address.
As we want to extend socklnd to work with IPv6 addresses too,
this needs to change.

This patch changes many u32s to variants of 'struct sockaddr'.

Library code from sunrpc is used for copying and comparing addresses
   rpc_copy_addr() and rpc_cmp_addr()
and for extracting or setting the port:
   rpc_get_port() and rpc_set_port().

The "%pIS" printf format is used for printing a sockaddr (works for
both IPv4 and IPv6), and "%pISp" for printing the address with the
port.

The u32 is in host-byte-order, while addresses in sockaddr are
always network-order, so htonl and ntohl are used as needed.

When storing an address (e.g. in a structure), 'struct
sockaddr_storage' is used.  When passing an address to a function,
'struct sockaddr' is used.  When an address is known to be IPv4 (i.e.
when converting to or from u32), 'struct sockaddr_in' is used.

The following functions are changed to take a 'struct sockaddr*'
argument:

 lnet_connect()
 lnet_connect_console_error()
 lnet_sock_getaddr()
 ksocknal_ip2iface()
 ksocknal_ip2index()
 ksocknal_create_route()
 ksocknal_connecting()
 ksocknal_close_peer_conns_locked()
 ksocknal_peer_del_interface_locked()

The following structures have had fields changed to 'struct
sockaddr_storage'

 struct ksock_interface:
      ksni_ipaddr -> ksni_addr
 struct ksock_conn
      ksnc_myipaddr -> ksnc_myaddr
      ksnc_ipaddr and ksnc_port -> ksnc_peeraddr
 struct ksock_route
      ksnr_myipaddr -> ksnr_myaddr
      ksnr_ipaddr and ksnr_port -> ksnr_addr

Assorted strings have been joined onto a single line, and various
indented have been changed from space to tabs.

There should be no behaviour changes, though the structures mentioned
above will now be a little larger.

WC-bug-id: https://jira.whamcloud.com/browse/LU-10391
Lustre-commit: c35c1babc7466ed ("LU-10391 socklnd: use sockaddr instead of __u32 addresses.")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/37704
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 include/linux/lnet/lib-lnet.h          |   9 +-
 net/lnet/klnds/socklnd/socklnd.c       | 330 +++++++++++++++++++++++----------
 net/lnet/klnds/socklnd/socklnd.h       |  12 +-
 net/lnet/klnds/socklnd/socklnd_cb.c    | 132 +++++++------
 net/lnet/klnds/socklnd/socklnd_lib.c   |   7 +-
 net/lnet/klnds/socklnd/socklnd_proto.c |  52 +++---
 net/lnet/lnet/acceptor.c               | 113 ++++++-----
 net/lnet/lnet/lib-socket.c             |  14 +-
 8 files changed, 392 insertions(+), 277 deletions(-)

diff --git a/include/linux/lnet/lib-lnet.h b/include/linux/lnet/lib-lnet.h
index e4dbe0e..2e88d80 100644
--- a/include/linux/lnet/lib-lnet.h
+++ b/include/linux/lnet/lib-lnet.h
@@ -713,10 +713,10 @@ void lnet_copy_kiov2iter(struct iov_iter *to,
 void lnet_register_lnd(struct lnet_lnd *lnd);
 void lnet_unregister_lnd(struct lnet_lnd *lnd);
 
-struct socket *lnet_connect(lnet_nid_t peer_nid, int interface, u32 peer_ip,
-			    int peer_port, struct net *ns);
+struct socket *lnet_connect(lnet_nid_t peer_nid, int interface,
+			    struct sockaddr *peeraddr, struct net *ns);
 void lnet_connect_console_error(int rc, lnet_nid_t peer_nid,
-				u32 peer_ip, int port);
+				struct sockaddr *sa);
 int lnet_count_acceptor_nets(void);
 int lnet_acceptor_timeout(void);
 int lnet_acceptor_port(void);
@@ -738,7 +738,8 @@ struct lnet_inetdev {
 int lnet_inet_enumerate(struct lnet_inetdev **dev_list, struct net *ns);
 int lnet_sock_setbuf(struct socket *socket, int txbufsize, int rxbufsize);
 int lnet_sock_getbuf(struct socket *socket, int *txbufsize, int *rxbufsize);
-int lnet_sock_getaddr(struct socket *socket, bool remote, u32 *ip, int *port);
+int lnet_sock_getaddr(struct socket *socket, bool remote,
+		      struct sockaddr_storage *peer);
 int lnet_sock_write(struct socket *sock, void *buffer, int nob, int timeout);
 int lnet_sock_read(struct socket *sock, void *buffer, int nob, int timeout);
 
diff --git a/net/lnet/klnds/socklnd/socklnd.c b/net/lnet/klnds/socklnd/socklnd.c
index 589a835..d5fe84d 100644
--- a/net/lnet/klnds/socklnd/socklnd.c
+++ b/net/lnet/klnds/socklnd/socklnd.c
@@ -40,13 +40,14 @@
 
 #include <linux/pci.h>
 #include <linux/inetdevice.h>
+#include <linux/sunrpc/addr.h>
 #include "socklnd.h"
 
 static struct lnet_lnd the_ksocklnd;
 struct ksock_nal_data ksocknal_data;
 
 static struct ksock_interface *
-ksocknal_ip2iface(struct lnet_ni *ni, u32 ip)
+ksocknal_ip2iface(struct lnet_ni *ni, struct sockaddr *addr)
 {
 	struct ksock_net *net = ni->ni_data;
 	int i;
@@ -56,7 +57,7 @@
 		LASSERT(i < LNET_INTERFACES_NUM);
 		iface = &net->ksnn_interfaces[i];
 
-		if (iface->ksni_ipaddr == ip)
+		if (rpc_cmp_addr((struct sockaddr *)&iface->ksni_addr, addr))
 			return iface;
 	}
 
@@ -81,12 +82,16 @@
 	return NULL;
 }
 
-static int ksocknal_ip2index(__u32 ipaddress, struct lnet_ni *ni)
+static int ksocknal_ip2index(struct sockaddr *addr, struct lnet_ni *ni)
 {
 	struct net_device *dev;
 	int ret = -1;
 	const struct in_ifaddr *ifa;
 
+	if (addr->sa_family != AF_INET)
+		/* No IPv6 support yet */
+		return ret;
+
 	rcu_read_lock();
 	for_each_netdev(ni->ni_net_ns, dev) {
 		int flags = dev_get_flags(dev);
@@ -103,7 +108,8 @@ static int ksocknal_ip2index(__u32 ipaddress, struct lnet_ni *ni)
 			continue;
 
 		in_dev_for_each_ifa_rcu(ifa, in_dev) {
-			if (ntohl(ifa->ifa_local) == ipaddress)
+			if (ifa->ifa_local ==
+			    ((struct sockaddr_in *)addr)->sin_addr.s_addr)
 				ret = dev->ifindex;
 		}
 		if (ret >= 0)
@@ -115,7 +121,7 @@ static int ksocknal_ip2index(__u32 ipaddress, struct lnet_ni *ni)
 }
 
 static struct ksock_route *
-ksocknal_create_route(u32 ipaddr, int port)
+ksocknal_create_route(struct sockaddr *addr)
 {
 	struct ksock_route *route;
 
@@ -126,9 +132,9 @@ static int ksocknal_ip2index(__u32 ipaddress, struct lnet_ni *ni)
 	refcount_set(&route->ksnr_refcount, 1);
 	route->ksnr_peer = NULL;
 	route->ksnr_retry_interval = 0;		/* OK to connect at any time */
-	route->ksnr_ipaddr = ipaddr;
+	rpc_copy_addr((struct sockaddr *)&route->ksnr_addr, addr);
+	rpc_set_port((struct sockaddr *)&route->ksnr_addr, rpc_get_port(addr));
 	route->ksnr_myiface = -1;
-	route->ksnr_port = port;
 	route->ksnr_scheduled = 0;
 	route->ksnr_connecting = 0;
 	route->ksnr_connected = 0;
@@ -259,14 +265,16 @@ struct ksock_peer_ni *
 ksocknal_unlink_peer_locked(struct ksock_peer_ni *peer_ni)
 {
 	int i;
-	u32 ip;
 	struct ksock_interface *iface;
 
 	for (i = 0; i < peer_ni->ksnp_n_passive_ips; i++) {
+		struct sockaddr_in sa = { .sin_family = AF_INET };
+
 		LASSERT(i < LNET_INTERFACES_NUM);
-		ip = peer_ni->ksnp_passive_ips[i];
+		sa.sin_addr.s_addr = htonl(peer_ni->ksnp_passive_ips[i]);
 
-		iface = ksocknal_ip2iface(peer_ni->ksnp_ni, ip);
+		iface = ksocknal_ip2iface(peer_ni->ksnp_ni,
+					  (struct sockaddr *)&sa);
 		/*
 		 * All IPs in peer_ni->ksnp_passive_ips[] come from the
 		 * interface list, therefore the call must succeed.
@@ -339,11 +347,22 @@ struct ksock_peer_ni *
 				continue;
 
 			*id = peer_ni->ksnp_id;
-			rc = choose_ipv4_src(myip, route->ksnr_myiface,
-					     route->ksnr_ipaddr,
-					     ni->ni_net_ns);
-			*peer_ip = route->ksnr_ipaddr;
-			*port = route->ksnr_port;
+			if (route->ksnr_addr.ss_family == AF_INET) {
+				struct sockaddr_in *sa;
+
+				sa = (void *)&route->ksnr_addr;
+				rc = choose_ipv4_src(myip,
+						     route->ksnr_myiface,
+						     ntohl(sa->sin_addr.s_addr),
+						     ni->ni_net_ns);
+				*peer_ip = ntohl(sa->sin_addr.s_addr);
+				*port = ntohs(sa->sin_port);
+			} else {
+				*myip = 0xFFFFFFFF;
+				*peer_ip = 0xFFFFFFFF;
+				*port = 0;
+				rc = -ENOTSUPP;
+			}
 			*conn_count = route->ksnr_conn_count;
 			*share_count = route->ksnr_share_count;
 			goto out;
@@ -361,24 +380,25 @@ struct ksock_peer_ni *
 	struct ksock_peer_ni *peer_ni = route->ksnr_peer;
 	int type = conn->ksnc_type;
 	struct ksock_interface *iface;
-	int conn_iface = ksocknal_ip2index(conn->ksnc_myipaddr,
-					   route->ksnr_peer->ksnp_ni);
+	int conn_iface;
 
+	conn_iface = ksocknal_ip2index((struct sockaddr *)&conn->ksnc_myaddr,
+				       route->ksnr_peer->ksnp_ni);
 	conn->ksnc_route = route;
 	ksocknal_route_addref(route);
 
 	if (route->ksnr_myiface != conn_iface) {
 		if (route->ksnr_myiface < 0) {
 			/* route wasn't bound locally yet (the initial route) */
-			CDEBUG(D_NET, "Binding %s %pI4h to interface %d\n",
+			CDEBUG(D_NET, "Binding %s %pIS to interface %d\n",
 			       libcfs_id2str(peer_ni->ksnp_id),
-			       &route->ksnr_ipaddr,
+			       &route->ksnr_addr,
 			       conn_iface);
 		} else {
 			CDEBUG(D_NET,
-			       "Rebinding %s %pI4h from interface %d to %d\n",
+			       "Rebinding %s %pIS from interface %d to %d\n",
 			       libcfs_id2str(peer_ni->ksnp_id),
-			       &route->ksnr_ipaddr,
+			       &route->ksnr_addr,
 			       route->ksnr_myiface,
 			       conn_iface);
 
@@ -420,10 +440,11 @@ struct ksock_peer_ni *
 
 	/* LASSERT(unique) */
 	list_for_each_entry(route2, &peer_ni->ksnp_routes, ksnr_list) {
-		if (route2->ksnr_ipaddr == route->ksnr_ipaddr) {
-			CERROR("Duplicate route %s %pI4h\n",
+		if (rpc_cmp_addr((struct sockaddr *)&route2->ksnr_addr,
+				 (struct sockaddr *)&route->ksnr_addr)) {
+			CERROR("Duplicate route %s %pIS\n",
 			       libcfs_id2str(peer_ni->ksnp_id),
-			       &route->ksnr_ipaddr);
+			       &route->ksnr_addr);
 			LBUG();
 		}
 	}
@@ -439,7 +460,8 @@ struct ksock_peer_ni *
 	list_add_tail(&route->ksnr_list, &peer_ni->ksnp_routes);
 
 	list_for_each_entry(conn, &peer_ni->ksnp_conns, ksnc_list) {
-		if (conn->ksnc_ipaddr != route->ksnr_ipaddr)
+		if (!rpc_cmp_addr((struct sockaddr *)&conn->ksnc_peeraddr,
+				  (struct sockaddr *)&route->ksnr_addr))
 			continue;
 
 		ksocknal_associate_route_conn_locked(route, conn);
@@ -494,6 +516,7 @@ struct ksock_peer_ni *
 	struct ksock_peer_ni *peer2;
 	struct ksock_route *route;
 	struct ksock_route *route2;
+	struct sockaddr_in sa = {.sin_family = AF_INET};
 
 	if (id.nid == LNET_NID_ANY ||
 	    id.pid == LNET_PID_ANY)
@@ -504,7 +527,9 @@ struct ksock_peer_ni *
 	if (IS_ERR(peer_ni))
 		return PTR_ERR(peer_ni);
 
-	route = ksocknal_create_route(ipaddr, port);
+	sa.sin_addr.s_addr = htonl(ipaddr);
+	sa.sin_port = htons(port);
+	route = ksocknal_create_route((struct sockaddr *)&sa);
 	if (!route) {
 		ksocknal_peer_decref(peer_ni);
 		return -ENOMEM;
@@ -525,7 +550,9 @@ struct ksock_peer_ni *
 	}
 
 	list_for_each_entry(route2, &peer_ni->ksnp_routes, ksnr_list) {
-		if (route2->ksnr_ipaddr == ipaddr) {
+		struct sockaddr_in *sa = (void *)&route->ksnr_addr;
+
+		if (ipaddr != ntohl(sa->sin_addr.s_addr)) {
 			/* Route already exists, use the old one */
 			ksocknal_route_decref(route);
 			route2->ksnr_share_count++;
@@ -557,8 +584,10 @@ struct ksock_peer_ni *
 
 	list_for_each_entry_safe(route, rnxt, &peer_ni->ksnp_routes,
 				 ksnr_list) {
+		struct sockaddr_in *sa = (void *)&route->ksnr_addr;
+
 		/* no match */
-		if (!(!ip || route->ksnr_ipaddr == ip))
+		if (!(!ip || ntohl(sa->sin_addr.s_addr) == ip))
 			continue;
 
 		route->ksnr_share_count = 0;
@@ -705,7 +734,7 @@ struct ksock_peer_ni *
 ksocknal_local_ipvec(struct lnet_ni *ni, u32 *ipaddrs)
 {
 	struct ksock_net *net = ni->ni_data;
-	int i;
+	int i, j;
 	int nip;
 
 	read_lock(&ksocknal_data.ksnd_global_lock);
@@ -713,22 +742,23 @@ struct ksock_peer_ni *
 	nip = net->ksnn_ninterfaces;
 	LASSERT(nip <= LNET_INTERFACES_NUM);
 
+	for (i = 0, j = 0; i < nip; i++)
+		if (net->ksnn_interfaces[i].ksni_addr.ss_family == AF_INET) {
+			struct sockaddr_in *sa =
+				(void *)&net->ksnn_interfaces[i].ksni_addr;
+
+			ipaddrs[j] = ntohl(sa->sin_addr.s_addr);
+			LASSERT(ipaddrs[j] != 0);
+			j += 1;
+		}
+	nip = j;
+
+	read_unlock(&ksocknal_data.ksnd_global_lock);
 	/*
 	 * Only offer interfaces for additional connections if I have
 	 * more than one.
 	 */
-	if (nip < 2) {
-		read_unlock(&ksocknal_data.ksnd_global_lock);
-		return 0;
-	}
-
-	for (i = 0; i < nip; i++) {
-		ipaddrs[i] = net->ksnn_interfaces[i].ksni_ipaddr;
-		LASSERT(ipaddrs[i]);
-	}
-
-	read_unlock(&ksocknal_data.ksnd_global_lock);
-	return nip;
+	return nip < 2 ? 0 : nip;
 }
 
 static int
@@ -740,12 +770,18 @@ struct ksock_peer_ni *
 	int this_xor;
 	int this_netmatch;
 	int i;
+	struct sockaddr_in *sa;
+	u32 ip;
+
+	sa = (struct sockaddr_in *)&iface->ksni_addr;
+	LASSERT(sa->sin_family == AF_INET);
+	ip = ntohl(sa->sin_addr.s_addr);
 
 	for (i = 0; i < nips; i++) {
 		if (!ips[i])
 			continue;
 
-		this_xor = ips[i] ^ iface->ksni_ipaddr;
+		this_xor = ips[i] ^ ip;
 		this_netmatch = !(this_xor & iface->ksni_netmask) ? 1 : 0;
 
 		if (!(best < 0 ||
@@ -814,13 +850,19 @@ struct ksock_peer_ni *
 		 */
 		if (i < peer_ni->ksnp_n_passive_ips) {
 			/* Old interface. */
-			ip = peer_ni->ksnp_passive_ips[i];
-			best_iface = ksocknal_ip2iface(peer_ni->ksnp_ni, ip);
+			struct sockaddr_in sa = { .sin_family = AF_INET};
+
+			sa.sin_addr.s_addr =
+				htonl(peer_ni->ksnp_passive_ips[i]);
+			best_iface = ksocknal_ip2iface(peer_ni->ksnp_ni,
+						       (struct sockaddr *)&sa);
 
 			/* peer_ni passive ips are kept up to date */
 			LASSERT(best_iface);
 		} else {
 			/* choose a new interface */
+			struct sockaddr_in *sa;
+
 			LASSERT(i == peer_ni->ksnp_n_passive_ips);
 
 			best_iface = NULL;
@@ -829,7 +871,10 @@ struct ksock_peer_ni *
 
 			for (j = 0; j < net->ksnn_ninterfaces; j++) {
 				iface = &net->ksnn_interfaces[j];
-				ip = iface->ksni_ipaddr;
+				sa = (void *)&iface->ksni_addr;
+				if (sa->sin_family != AF_INET)
+					continue;
+				ip = ntohl(sa->sin_addr.s_addr);
 
 				for (k = 0;
 				     k < peer_ni->ksnp_n_passive_ips;
@@ -860,7 +905,8 @@ struct ksock_peer_ni *
 			LASSERT(best_iface);
 
 			best_iface->ksni_npeers++;
-			ip = best_iface->ksni_ipaddr;
+			sa = (void *)&best_iface->ksni_addr;
+			ip = ntohl(sa->sin_addr.s_addr);
 			peer_ni->ksnp_passive_ips[i] = ip;
 			peer_ni->ksnp_n_passive_ips = i + 1;
 		}
@@ -916,11 +962,20 @@ struct ksock_peer_ni *
 
 	for (i = 0; i < npeer_ipaddrs; i++) {
 		if (newroute) {
-			newroute->ksnr_ipaddr = peer_ipaddrs[i];
+			struct sockaddr_in *sa = (void *)&newroute->ksnr_addr;
+
+			memset(sa, 0, sizeof(*sa));
+			sa->sin_family = AF_INET;
+			sa->sin_addr.s_addr = htonl(peer_ipaddrs[i]);
 		} else {
+			struct sockaddr_in sa = {.sin_family = AF_INET};
+
 			write_unlock_bh(global_lock);
 
-			newroute = ksocknal_create_route(peer_ipaddrs[i], port);
+			sa.sin_addr.s_addr = htonl(peer_ipaddrs[i]);
+			sa.sin_port = htons(port);
+			newroute =
+				ksocknal_create_route((struct sockaddr *)&sa);
 			if (!newroute)
 				return;
 
@@ -934,7 +989,8 @@ struct ksock_peer_ni *
 
 		/* Already got a route? */
 		list_for_each_entry(route, &peer_ni->ksnp_routes, ksnr_list)
-			if (route->ksnr_ipaddr != newroute->ksnr_ipaddr)
+			if (rpc_cmp_addr((struct sockaddr *)&route->ksnr_addr,
+					 (struct sockaddr *)&newroute->ksnr_addr))
 				goto next_ipaddr;
 
 		best_iface = NULL;
@@ -945,6 +1001,8 @@ struct ksock_peer_ni *
 
 		/* Select interface to connect from */
 		for (j = 0; j < net->ksnn_ninterfaces; j++) {
+			u32 iface_ip, route_ip;
+
 			iface = &net->ksnn_interfaces[j];
 
 			/* Using this interface already? */
@@ -953,9 +1011,20 @@ struct ksock_peer_ni *
 				if (route->ksnr_myiface == iface->ksni_index)
 					goto next_iface;
 
-			this_netmatch = (!((iface->ksni_ipaddr ^
-					   newroute->ksnr_ipaddr) &
-					   iface->ksni_netmask)) ? 1 : 0;
+			if (iface->ksni_addr.ss_family != AF_INET)
+				continue;
+			if (newroute->ksnr_addr.ss_family != AF_INET)
+				continue;
+
+			iface_ip =
+				ntohl(((struct sockaddr_in *)
+				      &iface->ksni_addr)->sin_addr.s_addr);
+			route_ip =
+				ntohl(((struct sockaddr_in *)
+				      &newroute->ksnr_addr)->sin_addr.s_addr);
+
+			this_netmatch = ((iface_ip ^ route_ip) &
+					  iface->ksni_netmask) ? 1 : 0;
 
 			if (!(!best_iface ||
 			      best_netmatch < this_netmatch ||
@@ -992,16 +1061,16 @@ struct ksock_peer_ni *
 {
 	struct ksock_connreq *cr;
 	int rc;
-	u32 peer_ip;
-	int peer_port;
+	struct sockaddr_storage peer;
 
-	rc = lnet_sock_getaddr(sock, 1, &peer_ip, &peer_port);
+	rc = lnet_sock_getaddr(sock, true, &peer);
 	LASSERT(!rc);			/* we succeeded before */
 
 	cr = kzalloc(sizeof(*cr), GFP_NOFS);
 	if (!cr) {
-		LCONSOLE_ERROR_MSG(0x12f, "Dropping connection request from %pI4h: memory exhausted\n",
-				   &peer_ip);
+		LCONSOLE_ERROR_MSG(0x12f,
+				   "Dropping connection request from %pIS: memory exhausted\n",
+				   &peer);
 		return -ENOMEM;
 	}
 
@@ -1019,12 +1088,12 @@ struct ksock_peer_ni *
 }
 
 static int
-ksocknal_connecting(struct ksock_peer_ni *peer_ni, u32 ipaddr)
+ksocknal_connecting(struct ksock_peer_ni *peer_ni, struct sockaddr *sa)
 {
 	struct ksock_route *route;
 
 	list_for_each_entry(route, &peer_ni->ksnp_routes, ksnr_list) {
-		if (route->ksnr_ipaddr == ipaddr)
+		if (rpc_cmp_addr((struct sockaddr *)&route->ksnr_addr, sa))
 			return route->ksnr_connecting;
 	}
 	return 0;
@@ -1044,6 +1113,7 @@ struct ksock_peer_ni *
 	struct ksock_peer_ni *peer2;
 	struct ksock_sched *sched;
 	struct ksock_hello_msg *hello;
+	struct sockaddr_in *sa;
 	int cpt;
 	struct ksock_tx *tx;
 	struct ksock_tx *txtmp;
@@ -1182,7 +1252,8 @@ struct ksock_peer_ni *
 		 * favour of higher NID...
 		 */
 		if (peerid.nid < ni->ni_nid &&
-		    ksocknal_connecting(peer_ni, conn->ksnc_ipaddr)) {
+		    ksocknal_connecting(peer_ni, ((struct sockaddr *)
+						 &conn->ksnc_peeraddr))) {
 			rc = EALREADY;
 			warn = "connection race resolution";
 			goto failed_2;
@@ -1212,7 +1283,7 @@ struct ksock_peer_ni *
 	if (peer_ni->ksnp_proto != conn->ksnc_proto ||
 	    peer_ni->ksnp_incarnation != incarnation) {
 		/* peer_ni rebooted or I've got the wrong protocol version */
-		ksocknal_close_peer_conns_locked(peer_ni, 0, 0);
+		ksocknal_close_peer_conns_locked(peer_ni, NULL, 0);
 
 		peer_ni->ksnp_proto = NULL;
 		rc = ESTALE;
@@ -1235,14 +1306,17 @@ struct ksock_peer_ni *
 		goto failed_2;
 	}
 
-	/*
-	 * Refuse to duplicate an existing connection, unless this is a
+	/* Refuse to duplicate an existing connection, unless this is a
 	 * loopback connection
 	 */
-	if (conn->ksnc_ipaddr != conn->ksnc_myipaddr) {
+	sa = (void *)&conn->ksnc_myaddr;
+	if (!rpc_cmp_addr((struct sockaddr *)&conn->ksnc_peeraddr,
+			  (struct sockaddr *)&conn->ksnc_myaddr)) {
 		list_for_each_entry(conn2, &peer_ni->ksnp_conns, ksnc_list) {
-			if (conn2->ksnc_ipaddr != conn->ksnc_ipaddr ||
-			    conn2->ksnc_myipaddr != conn->ksnc_myipaddr ||
+			if (!rpc_cmp_addr((struct sockaddr *)&conn2->ksnc_peeraddr,
+					  (struct sockaddr *)&conn->ksnc_peeraddr) ||
+			    !rpc_cmp_addr((struct sockaddr *)&conn2->ksnc_myaddr,
+					  (struct sockaddr *)&conn->ksnc_myaddr) ||
 			    conn2->ksnc_type != conn->ksnc_type)
 				continue;
 
@@ -1265,11 +1339,12 @@ struct ksock_peer_ni *
 	 * code below probably isn't going to work.
 	 */
 	if (active &&
-	    route->ksnr_ipaddr != conn->ksnc_ipaddr) {
-		CERROR("Route %s %pI4h connected to %pI4h\n",
+	    !rpc_cmp_addr((struct sockaddr *)&route->ksnr_addr,
+			  (struct sockaddr *)&conn->ksnc_peeraddr)) {
+		CERROR("Route %s %pIS connected to %pIS\n",
 		       libcfs_id2str(peer_ni->ksnp_id),
-		       &route->ksnr_ipaddr,
-		       &conn->ksnc_ipaddr);
+		       &route->ksnr_addr,
+		       &conn->ksnc_peeraddr);
 	}
 
 	/*
@@ -1279,7 +1354,8 @@ struct ksock_peer_ni *
 	 * continually create duplicate routes.
 	 */
 	list_for_each_entry(route, &peer_ni->ksnp_routes, ksnr_list) {
-		if (route->ksnr_ipaddr != conn->ksnc_ipaddr)
+		if (!rpc_cmp_addr((struct sockaddr *)&route->ksnr_addr,
+				  (struct sockaddr *)&conn->ksnc_peeraddr))
 			continue;
 
 		ksocknal_associate_route_conn_locked(route, conn);
@@ -1341,14 +1417,16 @@ struct ksock_peer_ni *
 	 *	socket callbacks.
 	 */
 	CDEBUG(D_NET,
-	       "New conn %s p %d.x %pI4h -> %pI4h/%d incarnation:%lld sched[%d]\n",
+	       "New conn %s p %d.x %pIS -> %pISp incarnation:%lld sched[%d]\n",
 	       libcfs_id2str(peerid), conn->ksnc_proto->pro_version,
-	       &conn->ksnc_myipaddr, &conn->ksnc_ipaddr,
-	       conn->ksnc_port, incarnation, cpt);
+	       &conn->ksnc_myaddr, &conn->ksnc_peeraddr,
+	       incarnation, cpt);
 
 	if (active) {
+		struct sockaddr *addr = (struct sockaddr *)&conn->ksnc_peeraddr;
+
 		/* additional routes after interface exchange? */
-		ksocknal_create_routes(peer_ni, conn->ksnc_port,
+		ksocknal_create_routes(peer_ni, rpc_get_port(addr),
 				       hello->kshm_ips, hello->kshm_nips);
 	} else {
 		hello->kshm_nips = ksocknal_select_ips(peer_ni, hello->kshm_ips,
@@ -1696,9 +1774,9 @@ struct ksock_peer_ni *
 	case SOCKNAL_RX_LNET_PAYLOAD:
 		last_rcv = conn->ksnc_rx_deadline -
 			   ksocknal_timeout();
-		CERROR("Completing partial receive from %s[%d], ip %pI4h:%d, with error, wanted: %zd, left: %d, last alive is %lld secs ago\n",
+		CERROR("Completing partial receive from %s[%d], ip %pISp, with error, wanted: %zd, left: %d, last alive is %lld secs ago\n",
 		       libcfs_id2str(conn->ksnc_peer->ksnp_id), conn->ksnc_type,
-		       &conn->ksnc_ipaddr, conn->ksnc_port,
+		       &conn->ksnc_peeraddr,
 		       iov_iter_count(&conn->ksnc_rx_to), conn->ksnc_rx_nob_left,
 		       ktime_get_seconds() - last_rcv);
 		if (conn->ksnc_lnet_msg)
@@ -1708,23 +1786,23 @@ struct ksock_peer_ni *
 		break;
 	case SOCKNAL_RX_LNET_HEADER:
 		if (conn->ksnc_rx_started)
-			CERROR("Incomplete receive of lnet header from %s, ip %pI4h:%d, with error, protocol: %d.x.\n",
+			CERROR("Incomplete receive of lnet header from %s, ip %pISp, with error, protocol: %d.x.\n",
 			       libcfs_id2str(conn->ksnc_peer->ksnp_id),
-			       &conn->ksnc_ipaddr, conn->ksnc_port,
+			       &conn->ksnc_peeraddr,
 			       conn->ksnc_proto->pro_version);
 		break;
 	case SOCKNAL_RX_KSM_HEADER:
 		if (conn->ksnc_rx_started)
-			CERROR("Incomplete receive of ksock message from %s, ip %pI4h:%d, with error, protocol: %d.x.\n",
+			CERROR("Incomplete receive of ksock message from %s, ip %pISp, with error, protocol: %d.x.\n",
 			       libcfs_id2str(conn->ksnc_peer->ksnp_id),
-			       &conn->ksnc_ipaddr, conn->ksnc_port,
+			       &conn->ksnc_peeraddr,
 			       conn->ksnc_proto->pro_version);
 		break;
 	case SOCKNAL_RX_SLOP:
 		if (conn->ksnc_rx_started)
-			CERROR("Incomplete receive of slops from %s, ip %pI4h:%d, with error\n",
+			CERROR("Incomplete receive of slops from %s, ip %pISp, with error\n",
 			       libcfs_id2str(conn->ksnc_peer->ksnp_id),
-			       &conn->ksnc_ipaddr, conn->ksnc_port);
+			       &conn->ksnc_peeraddr);
 	       break;
 	default:
 		LBUG();
@@ -1738,14 +1816,16 @@ struct ksock_peer_ni *
 
 int
 ksocknal_close_peer_conns_locked(struct ksock_peer_ni *peer_ni,
-				 u32 ipaddr, int why)
+				 struct sockaddr *addr, int why)
 {
 	struct ksock_conn *conn;
 	struct ksock_conn *cnxt;
 	int count = 0;
 
 	list_for_each_entry_safe(conn, cnxt, &peer_ni->ksnp_conns, ksnc_list) {
-		if (!ipaddr || conn->ksnc_ipaddr == ipaddr) {
+		if (!addr ||
+		    rpc_cmp_addr(addr,
+				 (struct sockaddr *)&conn->ksnc_peeraddr)) {
 			count++;
 			ksocknal_close_conn_locked(conn, why);
 		}
@@ -1757,13 +1837,13 @@ struct ksock_peer_ni *
 int
 ksocknal_close_conn_and_siblings(struct ksock_conn *conn, int why)
 {
+	struct sockaddr *paddr = (struct sockaddr *)&conn->ksnc_peeraddr;
 	struct ksock_peer_ni *peer_ni = conn->ksnc_peer;
-	u32 ipaddr = conn->ksnc_ipaddr;
 	int count;
 
 	write_lock_bh(&ksocknal_data.ksnd_global_lock);
 
-	count = ksocknal_close_peer_conns_locked(peer_ni, ipaddr, why);
+	count = ksocknal_close_peer_conns_locked(peer_ni, paddr, why);
 
 	write_unlock_bh(&ksocknal_data.ksnd_global_lock);
 
@@ -1779,6 +1859,7 @@ struct ksock_peer_ni *
 	int hi;
 	int i;
 	int count = 0;
+	struct sockaddr_in sa = {.sin_family = AF_INET};
 
 	write_lock_bh(&ksocknal_data.ksnd_global_lock);
 
@@ -1790,6 +1871,7 @@ struct ksock_peer_ni *
 		hi = HASH_SIZE(ksocknal_data.ksnd_peers) - 1;
 	}
 
+	sa.sin_addr.s_addr = htonl(ipaddr);
 	for (i = lo; i <= hi; i++) {
 		hlist_for_each_entry_safe(peer_ni, pnxt,
 					  &ksocknal_data.ksnd_peers[i],
@@ -1801,7 +1883,8 @@ struct ksock_peer_ni *
 				continue;
 
 			count += ksocknal_close_peer_conns_locked(peer_ni,
-								  ipaddr, 0);
+								  ipaddr  ? (struct sockaddr *)&sa : NULL,
+								  0);
 		}
 	}
 
@@ -1923,6 +2006,7 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 {
 	struct ksock_net *net = ni->ni_data;
 	struct ksock_interface *iface;
+	struct sockaddr_in sa = { .sin_family = AF_INET };
 	int rc;
 	int i;
 	int j;
@@ -1934,7 +2018,8 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 
 	write_lock_bh(&ksocknal_data.ksnd_global_lock);
 
-	iface = ksocknal_ip2iface(ni, ipaddress);
+	sa.sin_addr.s_addr = htonl(ipaddress);
+	iface = ksocknal_ip2iface(ni, (struct sockaddr *)&sa);
 	if (iface) {
 		/* silently ignore dups */
 		rc = 0;
@@ -1943,8 +2028,10 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 	} else {
 		iface = &net->ksnn_interfaces[net->ksnn_ninterfaces++];
 
-		iface->ksni_index = ksocknal_ip2index(ipaddress, ni);
-		iface->ksni_ipaddr = ipaddress;
+		iface->ksni_index = ksocknal_ip2index((struct sockaddr *)&sa,
+						      ni);
+		rpc_copy_addr((struct sockaddr *)&iface->ksni_addr,
+			      (struct sockaddr *)&sa);
 		iface->ksni_netmask = netmask;
 		iface->ksni_nroutes = 0;
 		iface->ksni_npeers = 0;
@@ -2008,7 +2095,7 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 	}
 
 	list_for_each_entry_safe(conn, cnxt, &peer_ni->ksnp_conns, ksnc_list)
-		if (conn->ksnc_myipaddr == ipaddr)
+		if (conn->ksnc_route->ksnr_myiface == index)
 			ksocknal_close_conn_locked(conn, 0);
 }
 
@@ -2020,16 +2107,23 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 	struct hlist_node *nxt;
 	struct ksock_peer_ni *peer_ni;
 	u32 this_ip;
+	struct sockaddr_in sa = {.sin_family = AF_INET };
 	int index;
 	int i;
 	int j;
 
-	index = ksocknal_ip2index(ipaddress, ni);
+	sa.sin_addr.s_addr = htonl(ipaddress);
+	index = ksocknal_ip2index((struct sockaddr *)&sa, ni);
 
 	write_lock_bh(&ksocknal_data.ksnd_global_lock);
 
 	for (i = 0; i < net->ksnn_ninterfaces; i++) {
-		this_ip = net->ksnn_interfaces[i].ksni_ipaddr;
+		struct sockaddr_in *sa =
+			(void *)&net->ksnn_interfaces[i].ksni_addr;
+
+		if (sa->sin_family != AF_INET)
+			continue;
+		this_ip = ntohl(sa->sin_addr.s_addr);
 
 		if (!(!ipaddress || ipaddress == this_ip))
 			continue;
@@ -2068,6 +2162,7 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 	case IOC_LIBCFS_GET_INTERFACE: {
 		struct ksock_net *net = ni->ni_data;
 		struct ksock_interface *iface;
+		struct sockaddr_in *sa;
 
 		read_lock(&ksocknal_data.ksnd_global_lock);
 
@@ -2077,7 +2172,11 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 			rc = 0;
 			iface = &net->ksnn_interfaces[data->ioc_count];
 
-			data->ioc_u32[0] = iface->ksni_ipaddr;
+			sa = (void *)&iface->ksni_addr;
+			if (sa->sin_family == AF_INET)
+				data->ioc_u32[0] = ntohl(sa->sin_addr.s_addr);
+			else
+				data->ioc_u32[0] = 0xFFFFFFFF;
 			data->ioc_u32[1] = iface->ksni_netmask;
 			data->ioc_u32[2] = iface->ksni_npeers;
 			data->ioc_u32[3] = iface->ksni_nroutes;
@@ -2137,19 +2236,30 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 		int rxmem;
 		int nagle;
 		struct ksock_conn *conn;
+		struct sockaddr_in *psa;
+		struct sockaddr_in *mysa;
 
 		conn = ksocknal_get_conn_by_idx(ni, data->ioc_count);
 		if (!conn)
 			return -ENOENT;
 
+		mysa = (void *)&conn->ksnc_myaddr;
+		psa = (void *)&conn->ksnc_peeraddr;
 		ksocknal_lib_get_conn_tunables(conn, &txmem, &rxmem, &nagle);
 
 		data->ioc_count = txmem;
 		data->ioc_nid = conn->ksnc_peer->ksnp_id.nid;
 		data->ioc_flags = nagle;
-		data->ioc_u32[0] = conn->ksnc_ipaddr;
-		data->ioc_u32[1] = conn->ksnc_port;
-		data->ioc_u32[2] = conn->ksnc_myipaddr;
+		if (psa->sin_family == AF_INET)
+			data->ioc_u32[0] = ntohl(psa->sin_addr.s_addr);
+		else
+			data->ioc_u32[0] = 0xFFFFFFFF;
+		data->ioc_u32[1] = rpc_get_port((struct sockaddr *)
+						&conn->ksnc_peeraddr);
+		if (mysa->sin_family == AF_INET)
+			data->ioc_u32[2] = ntohl(mysa->sin_addr.s_addr);
+		else
+			data->ioc_u32[2] = 0xFFFFFFFF;
 		data->ioc_u32[3] = conn->ksnc_type;
 		data->ioc_u32[4] = conn->ksnc_scheduler->kss_cpt;
 		data->ioc_u32[5] = rxmem;
@@ -2650,13 +2760,18 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 		goto fail_1;
 
 	if (!ni->ni_interfaces[0]) {
+		struct sockaddr_in *sa;
+
 		ksi = &net->ksnn_interfaces[0];
+		sa = (void *)&ksi->ksni_addr;
 
 		/* Use the first discovered interface */
 		net->ksnn_ninterfaces = 1;
 		ni->ni_dev_cpt = ifaces[0].li_cpt;
-		ksi->ksni_ipaddr = ifaces[0].li_ipaddr;
-		ksi->ksni_index = ksocknal_ip2index(ksi->ksni_ipaddr, ni);
+		memset(sa, 0, sizeof(*sa));
+		sa->sin_family = AF_INET;
+		sa->sin_addr.s_addr = htonl(ifaces[0].li_ipaddr);
+		ksi->ksni_index = ksocknal_ip2index((struct sockaddr *)sa, ni);
 		ksi->ksni_netmask = ifaces[0].li_netmask;
 		strlcpy(ksi->ksni_name, ifaces[0].li_name,
 			sizeof(ksi->ksni_name));
@@ -2689,15 +2804,22 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 			}
 
 			for (j = 0; j < rc; j++) {
+				struct sockaddr_in *sa;
+
 				if (strcmp(ifaces[j].li_name,
 					   ni->ni_interfaces[i]) != 0)
 					continue;
 
 				ksi = &net->ksnn_interfaces[net->ksnn_ninterfaces];
+				sa = (void *)&ksi->ksni_addr;
 				ni->ni_dev_cpt = ifaces[j].li_cpt;
-				ksi->ksni_ipaddr = ifaces[j].li_ipaddr;
+				memset(sa, 0, sizeof(*sa));
+				sa->sin_family = AF_INET;
+				sa->sin_addr.s_addr =
+					htonl(ifaces[j].li_ipaddr);
 				ksi->ksni_index =
-					ksocknal_ip2index(ksi->ksni_ipaddr, ni);
+					ksocknal_ip2index((struct sockaddr *)sa,
+							  ni);
 				ksi->ksni_netmask = ifaces[j].li_netmask;
 				strlcpy(ksi->ksni_name, ifaces[j].li_name,
 					sizeof(ksi->ksni_name));
@@ -2730,7 +2852,9 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 		goto fail_1;
 
 	LASSERT(ksi);
-	ni->ni_nid = LNET_MKNID(LNET_NIDNET(ni->ni_nid), ksi->ksni_ipaddr);
+	LASSERT(ksi->ksni_addr.ss_family == AF_INET);
+	ni->ni_nid = LNET_MKNID(LNET_NIDNET(ni->ni_nid),
+				ntohl(((struct sockaddr_in *)&ksi->ksni_addr)->sin_addr.s_addr));
 	list_add(&net->ksnn_list, &ksocknal_data.ksnd_nets);
 
 	ksocknal_data.ksnd_nnets++;
diff --git a/net/lnet/klnds/socklnd/socklnd.h b/net/lnet/klnds/socklnd/socklnd.h
index 261cbb46..83f0e3c 100644
--- a/net/lnet/klnds/socklnd/socklnd.h
+++ b/net/lnet/klnds/socklnd/socklnd.h
@@ -100,7 +100,7 @@ struct ksock_sched {				/* per scheduler state */
 
 struct ksock_interface {			/* in-use interface */
 	int		ksni_index;		/* Linux interface index */
-	u32		ksni_ipaddr;		/* interface's IP address */
+	struct sockaddr_storage ksni_addr;	/* interface's address */
 	u32		ksni_netmask;		/* interface's network mask */
 	int		ksni_nroutes;		/* # routes using (active) */
 	int		ksni_npeers;		/* # peers using (passive) */
@@ -316,9 +316,8 @@ struct ksock_conn {
 	refcount_t		ksnc_sock_refcount;	/* sock refcount */
 	struct ksock_sched     *ksnc_scheduler;		/* who schedules this connection
 							 */
-	u32			ksnc_myipaddr;		/* my IP */
-	u32			ksnc_ipaddr;		/* peer_ni's IP */
-	int			ksnc_port;		/* peer_ni's port */
+	struct sockaddr_storage	ksnc_myaddr;		/* my address */
+	struct sockaddr_storage ksnc_peeraddr;		/* peer_ni's address */
 	signed int		ksnc_type:3;		/* type of connection, should be
 							 * signed value
 							 */
@@ -381,8 +380,7 @@ struct ksock_route {
 							 */
 	time64_t		ksnr_retry_interval;	/* how long between retries */
 	int			ksnr_myiface;		/* my IP */
-	u32			ksnr_ipaddr;		/* IP address to connect to */
-	int			ksnr_port;		/* port to connect to */
+	struct sockaddr_storage	ksnr_addr;		/* IP address to connect to */
 	unsigned int		ksnr_scheduled:1;	/* scheduled for attention */
 	unsigned int		ksnr_connecting:1;	/* connection establishment in
 							 * progress
@@ -624,7 +622,7 @@ int ksocknal_create_conn(struct lnet_ni *ni, struct ksock_route *route,
 void ksocknal_terminate_conn(struct ksock_conn *conn);
 void ksocknal_destroy_conn(struct ksock_conn *conn);
 int ksocknal_close_peer_conns_locked(struct ksock_peer_ni *peer_ni,
-				     u32 ipaddr, int why);
+				     struct sockaddr *peer, int why);
 int ksocknal_close_conn_and_siblings(struct ksock_conn *conn, int why);
 int ksocknal_close_matching_conns(struct lnet_process_id id, u32 ipaddr);
 struct ksock_conn *ksocknal_find_conn_locked(struct ksock_peer_ni *peer_ni,
diff --git a/net/lnet/klnds/socklnd/socklnd_cb.c b/net/lnet/klnds/socklnd/socklnd_cb.c
index b1146dc..bfc4e2e 100644
--- a/net/lnet/klnds/socklnd/socklnd_cb.c
+++ b/net/lnet/klnds/socklnd/socklnd_cb.c
@@ -23,6 +23,7 @@
  */
 
 #include <linux/sched/mm.h>
+#include <linux/sunrpc/addr.h>
 #include "socklnd.h"
 
 struct ksock_tx *
@@ -532,19 +533,17 @@ struct ksock_tx *
 	if (!conn->ksnc_closing) {
 		switch (rc) {
 		case -ECONNRESET:
-			LCONSOLE_WARN("Host %pI4h reset our connection while we were sending data; it may have rebooted.\n",
-				      &conn->ksnc_ipaddr);
+			LCONSOLE_WARN("Host %pIS reset our connection while we were sending data; it may have rebooted.\n",
+				      &conn->ksnc_peeraddr);
 			break;
 		default:
-			LCONSOLE_WARN("There was an unexpected network error while writing to %pI4h: %d.\n",
-				      &conn->ksnc_ipaddr, rc);
+			LCONSOLE_WARN("There was an unexpected network error while writing to %pIS: %d.\n",
+				      &conn->ksnc_peeraddr, rc);
 			break;
 		}
-		CDEBUG(D_NET, "[%p] Error %d on write to %s ip %pI4h:%d\n",
-		       conn, rc,
-		       libcfs_id2str(conn->ksnc_peer->ksnp_id),
-		       &conn->ksnc_ipaddr,
-		       conn->ksnc_port);
+		CDEBUG(D_NET, "[%p] Error %d on write to %s ip %pISp\n",
+		       conn, rc, libcfs_id2str(conn->ksnc_peer->ksnp_id),
+		       &conn->ksnc_peeraddr);
 	}
 
 	if (tx->tx_zc_checked)
@@ -676,9 +675,9 @@ struct ksock_conn *
 	 */
 	LASSERT(!conn->ksnc_closing);
 
-	CDEBUG(D_NET, "Sending to %s ip %pI4h:%d\n",
+	CDEBUG(D_NET, "Sending to %s ip %pISp\n",
 	       libcfs_id2str(conn->ksnc_peer->ksnp_id),
-	       &conn->ksnc_ipaddr, conn->ksnc_port);
+	       &conn->ksnc_peeraddr);
 
 	ksocknal_tx_prep(conn, tx);
 
@@ -774,8 +773,8 @@ struct ksock_route *
 		if (!(!route->ksnr_retry_interval || /* first attempt */
 		      now >= route->ksnr_timeout)) {
 			CDEBUG(D_NET,
-			       "Too soon to retry route %pI4h (cnted %d, interval %lld, %lld secs later)\n",
-			       &route->ksnr_ipaddr,
+			       "Too soon to retry route %pIS (cnted %d, interval %lld, %lld secs later)\n",
+			       &route->ksnr_addr,
 			       route->ksnr_connected,
 			       route->ksnr_retry_interval,
 			       route->ksnr_timeout - now);
@@ -1081,20 +1080,20 @@ struct ksock_route *
 		rc = ksocknal_receive(conn);
 
 		if (rc <= 0) {
+			struct lnet_process_id ksnp_id;
+
+			ksnp_id = conn->ksnc_peer->ksnp_id;
+
 			LASSERT(rc != -EAGAIN);
 
 			if (!rc)
-				CDEBUG(D_NET, "[%p] EOF from %s ip %pI4h:%d\n",
-				       conn,
-				       libcfs_id2str(conn->ksnc_peer->ksnp_id),
-				       &conn->ksnc_ipaddr,
-				       conn->ksnc_port);
+				CDEBUG(D_NET, "[%p] EOF from %s ip %pISp\n",
+				       conn, libcfs_id2str(ksnp_id),
+				       &conn->ksnc_peeraddr);
 			else if (!conn->ksnc_closing)
-				CERROR("[%p] Error %d on read from %s ip %pI4h:%d\n",
-				       conn, rc,
-				       libcfs_id2str(conn->ksnc_peer->ksnp_id),
-				       &conn->ksnc_ipaddr,
-				       conn->ksnc_port);
+				CERROR("[%p] Error %d on read from %s ip %pISp\n",
+				       conn, rc, libcfs_id2str(ksnp_id),
+				       &conn->ksnc_peeraddr);
 
 			/* it's not an error if conn is being closed */
 			ksocknal_close_conn_and_siblings(conn,
@@ -1647,8 +1646,8 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 	rc = lnet_sock_read(sock, &hello->kshm_magic,
 			    sizeof(hello->kshm_magic), timeout);
 	if (rc) {
-		CERROR("Error %d reading HELLO from %pI4h\n",
-		       rc, &conn->ksnc_ipaddr);
+		CERROR("Error %d reading HELLO from %pIS\n",
+		       rc, &conn->ksnc_peeraddr);
 		LASSERT(rc < 0);
 		return rc;
 	}
@@ -1657,18 +1656,17 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 	    hello->kshm_magic != __swab32(LNET_PROTO_MAGIC) &&
 	    hello->kshm_magic != le32_to_cpu(LNET_PROTO_TCP_MAGIC)) {
 		/* Unexpected magic! */
-		CERROR("Bad magic(1) %#08x (%#08x expected) from %pI4h\n",
+		CERROR("Bad magic(1) %#08x (%#08x expected) from %pIS\n",
 		       __cpu_to_le32(hello->kshm_magic),
-		       LNET_PROTO_TCP_MAGIC,
-		       &conn->ksnc_ipaddr);
+		       LNET_PROTO_TCP_MAGIC, &conn->ksnc_peeraddr);
 		return -EPROTO;
 	}
 
 	rc = lnet_sock_read(sock, &hello->kshm_version,
 			    sizeof(hello->kshm_version), timeout);
 	if (rc) {
-		CERROR("Error %d reading HELLO from %pI4h\n",
-		       rc, &conn->ksnc_ipaddr);
+		CERROR("Error %d reading HELLO from %pIS\n",
+		       rc, &conn->ksnc_peeraddr);
 		LASSERT(rc < 0);
 		return rc;
 	}
@@ -1690,9 +1688,9 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 			ksocknal_send_hello(ni, conn, ni->ni_nid, hello);
 		}
 
-		CERROR("Unknown protocol version (%d.x expected) from %pI4h\n",
+		CERROR("Unknown protocol version (%d.x expected) from %pIS\n",
 		       conn->ksnc_proto->pro_version,
-		       &conn->ksnc_ipaddr);
+		       &conn->ksnc_peeraddr);
 
 		return -EPROTO;
 	}
@@ -1703,8 +1701,8 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 	/* receive the rest of hello message anyway */
 	rc = conn->ksnc_proto->pro_recv_hello(conn, hello, timeout);
 	if (rc) {
-		CERROR("Error %d reading or checking hello from from %pI4h\n",
-		       rc, &conn->ksnc_ipaddr);
+		CERROR("Error %d reading or checking hello from from %pIS\n",
+		       rc, &conn->ksnc_peeraddr);
 		LASSERT(rc < 0);
 		return rc;
 	}
@@ -1712,17 +1710,21 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 	*incarnation = hello->kshm_src_incarnation;
 
 	if (hello->kshm_src_nid == LNET_NID_ANY) {
-		CERROR("Expecting a HELLO hdr with a NID, but got LNET_NID_ANY from %pI4h\n",
-		       &conn->ksnc_ipaddr);
+		CERROR("Expecting a HELLO hdr with a NID, but got LNET_NID_ANY from %pIS\n",
+		       &conn->ksnc_peeraddr);
 		return -EPROTO;
 	}
 
 	if (!active &&
-	    conn->ksnc_port > LNET_ACCEPTOR_MAX_RESERVED_PORT) {
+	    rpc_get_port((struct sockaddr *)&conn->ksnc_peeraddr) >
+	    LNET_ACCEPTOR_MAX_RESERVED_PORT) {
 		/* Userspace NAL assigns peer_ni process ID from socket */
-		recv_id.pid = conn->ksnc_port | LNET_PID_USERFLAG;
+		recv_id.pid = rpc_get_port((struct sockaddr *)
+					   &conn->ksnc_peeraddr) |
+					   LNET_PID_USERFLAG;
 		recv_id.nid = LNET_MKNID(LNET_NIDNET(ni->ni_nid),
-					 conn->ksnc_ipaddr);
+					 ntohl(((struct sockaddr_in *)
+					 &conn->ksnc_peeraddr)->sin_addr.s_addr));
 	} else {
 		recv_id.nid = hello->kshm_src_nid;
 		recv_id.pid = hello->kshm_src_pid;
@@ -1734,9 +1736,9 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 		/* peer_ni determines type */
 		conn->ksnc_type = ksocknal_invert_type(hello->kshm_ctype);
 		if (conn->ksnc_type == SOCKLND_CONN_NONE) {
-			CERROR("Unexpected type %d from %s ip %pI4h\n",
+			CERROR("Unexpected type %d from %s ip %pIS\n",
 			       hello->kshm_ctype, libcfs_id2str(*peerid),
-			       &conn->ksnc_ipaddr);
+			       &conn->ksnc_peeraddr);
 			return -EPROTO;
 		}
 
@@ -1745,9 +1747,10 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 
 	if (peerid->pid != recv_id.pid ||
 	    peerid->nid != recv_id.nid) {
-		LCONSOLE_ERROR_MSG(0x130, "Connected successfully to %s on host %pI4h, but they claimed they were %s; please check your Lustre configuration.\n",
+		LCONSOLE_ERROR_MSG(0x130,
+				   "Connected successfully to %s on host %pIS, but they claimed they were %s; please check your Lustre configuration.\n",
 				   libcfs_id2str(*peerid),
-				   &conn->ksnc_ipaddr,
+				   &conn->ksnc_peeraddr,
 				   libcfs_id2str(recv_id));
 		return -EPROTO;
 	}
@@ -1758,9 +1761,9 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 	}
 
 	if (ksocknal_invert_type(hello->kshm_ctype) != conn->ksnc_type) {
-		CERROR("Mismatched types: me %d, %s ip %pI4h %d\n",
+		CERROR("Mismatched types: me %d, %s ip %pIS %d\n",
 		       conn->ksnc_type, libcfs_id2str(*peerid),
-		       &conn->ksnc_ipaddr, hello->kshm_ctype);
+		       &conn->ksnc_peeraddr, hello->kshm_ctype);
 		return -EPROTO;
 	}
 
@@ -1829,14 +1832,14 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 		if (ktime_get_seconds() >= deadline) {
 			rc = -ETIMEDOUT;
 			lnet_connect_console_error(rc, peer_ni->ksnp_id.nid,
-						   route->ksnr_ipaddr,
-						   route->ksnr_port);
+						   (struct sockaddr *)
+						   &route->ksnr_addr);
 			goto failed;
 		}
 
 		sock = lnet_connect(peer_ni->ksnp_id.nid,
 				    route->ksnr_myiface,
-				    route->ksnr_ipaddr, route->ksnr_port,
+				    (struct sockaddr *)&route->ksnr_addr,
 				    peer_ni->ksnp_ni->ni_net_ns);
 		if (IS_ERR(sock)) {
 			rc = PTR_ERR(sock);
@@ -1846,8 +1849,8 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 		rc = ksocknal_create_conn(peer_ni->ksnp_ni, route, sock, type);
 		if (rc < 0) {
 			lnet_connect_console_error(rc, peer_ni->ksnp_id.nid,
-						   route->ksnr_ipaddr,
-						   route->ksnr_port);
+						   (struct sockaddr *)
+						   &route->ksnr_addr);
 			goto failed;
 		}
 
@@ -2135,8 +2138,8 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 			if (ksocknal_connect(route)) {
 				/* consecutive retry */
 				if (cons_retry++ > SOCKNAL_INSANITY_RECONN) {
-					CWARN("massive consecutive re-connecting to %pI4h\n",
-					      &route->ksnr_ipaddr);
+					CWARN("massive consecutive re-connecting to %pIS\n",
+					      &route->ksnr_addr);
 					cons_retry = 0;
 				}
 			} else {
@@ -2195,23 +2198,20 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 
 			switch (error) {
 			case ECONNRESET:
-				CNETERR("A connection with %s (%pI4h:%d) was reset; it may have rebooted.\n",
+				CNETERR("A connection with %s (%pISp) was reset; it may have rebooted.\n",
 					libcfs_id2str(peer_ni->ksnp_id),
-					&conn->ksnc_ipaddr,
-					conn->ksnc_port);
+					&conn->ksnc_peeraddr);
 				break;
 			case ETIMEDOUT:
-				CNETERR("A connection with %s (%pI4h:%d) timed out; the network or node may be down.\n",
+				CNETERR("A connection with %s (%pISp) timed out; the network or node may be down.\n",
 					libcfs_id2str(peer_ni->ksnp_id),
-					&conn->ksnc_ipaddr,
-					conn->ksnc_port);
+					&conn->ksnc_peeraddr);
 				break;
 			default:
-				CNETERR("An unexpected network error %d occurred with %s (%pI4h:%d\n",
+				CNETERR("An unexpected network error %d occurred with %s (%pISp\n",
 					error,
 					libcfs_id2str(peer_ni->ksnp_id),
-					&conn->ksnc_ipaddr,
-					conn->ksnc_port);
+					&conn->ksnc_peeraddr);
 				break;
 			}
 
@@ -2222,10 +2222,9 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 		    ktime_get_seconds() >= conn->ksnc_rx_deadline) {
 			/* Timed out incomplete incoming message */
 			ksocknal_conn_addref(conn);
-			CNETERR("Timeout receiving from %s (%pI4h:%d), state %d wanted %zd left %d\n",
+			CNETERR("Timeout receiving from %s (%pISp), state %d wanted %zd left %d\n",
 				libcfs_id2str(peer_ni->ksnp_id),
-				&conn->ksnc_ipaddr,
-				conn->ksnc_port,
+				&conn->ksnc_peeraddr,
 				conn->ksnc_rx_state,
 				iov_iter_count(&conn->ksnc_rx_to),
 				conn->ksnc_rx_nob_left);
@@ -2244,10 +2243,9 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 					    tx_list)
 				tx->tx_hstatus =
 					LNET_MSG_STATUS_LOCAL_TIMEOUT;
-			CNETERR("Timeout sending data to %s (%pI4h:%d) the network or that node may be down.\n",
+			CNETERR("Timeout sending data to %s (%pISp) the network or that node may be down.\n",
 				libcfs_id2str(peer_ni->ksnp_id),
-				&conn->ksnc_ipaddr,
-				conn->ksnc_port);
+				&conn->ksnc_peeraddr);
 			return conn;
 		}
 	}
diff --git a/net/lnet/klnds/socklnd/socklnd_lib.c b/net/lnet/klnds/socklnd/socklnd_lib.c
index 1d6cd0e..6ce5ca4 100644
--- a/net/lnet/klnds/socklnd/socklnd_lib.c
+++ b/net/lnet/klnds/socklnd/socklnd_lib.c
@@ -37,8 +37,8 @@
 int
 ksocknal_lib_get_conn_addrs(struct ksock_conn *conn)
 {
-	int rc = lnet_sock_getaddr(conn->ksnc_sock, 1, &conn->ksnc_ipaddr,
-				   &conn->ksnc_port);
+	int rc = lnet_sock_getaddr(conn->ksnc_sock, true,
+				   &conn->ksnc_peeraddr);
 
 	/* Didn't need the {get,put}connsock dance to deref ksnc_sock... */
 	LASSERT(!conn->ksnc_closing);
@@ -48,7 +48,8 @@
 		return rc;
 	}
 
-	rc = lnet_sock_getaddr(conn->ksnc_sock, 0, &conn->ksnc_myipaddr, NULL);
+	rc = lnet_sock_getaddr(conn->ksnc_sock, false,
+			       &conn->ksnc_myaddr);
 	if (rc) {
 		CERROR("Error %d getting sock local IP\n", rc);
 		return rc;
diff --git a/net/lnet/klnds/socklnd/socklnd_proto.c b/net/lnet/klnds/socklnd/socklnd_proto.c
index bc9f349..0a6072b 100644
--- a/net/lnet/klnds/socklnd/socklnd_proto.c
+++ b/net/lnet/klnds/socklnd/socklnd_proto.c
@@ -499,8 +499,8 @@
 
 	rc = lnet_sock_write(sock, hdr, sizeof(*hdr), lnet_acceptor_timeout());
 	if (rc) {
-		CNETERR("Error %d sending HELLO hdr to %pI4h/%d\n",
-			rc, &conn->ksnc_ipaddr, conn->ksnc_port);
+		CNETERR("Error %d sending HELLO hdr to %pISp\n",
+			rc, &conn->ksnc_peeraddr);
 		goto out;
 	}
 
@@ -514,9 +514,9 @@
 			     hello->kshm_nips * sizeof(u32),
 			     lnet_acceptor_timeout());
 	if (rc) {
-		CNETERR("Error %d sending HELLO payload (%d) to %pI4h/%d\n",
+		CNETERR("Error %d sending HELLO payload (%d) to %pISp\n",
 			rc, hello->kshm_nips,
-			&conn->ksnc_ipaddr, conn->ksnc_port);
+			&conn->ksnc_peeraddr);
 	}
 out:
 	kfree(hdr);
@@ -542,8 +542,8 @@
 	rc = lnet_sock_write(sock, hello, offsetof(struct ksock_hello_msg, kshm_ips),
 			     lnet_acceptor_timeout());
 	if (rc) {
-		CNETERR("Error %d sending HELLO hdr to %pI4h/%d\n",
-			rc, &conn->ksnc_ipaddr, conn->ksnc_port);
+		CNETERR("Error %d sending HELLO hdr to %pISp\n",
+			rc, &conn->ksnc_peeraddr);
 		return rc;
 	}
 
@@ -554,9 +554,9 @@
 			     hello->kshm_nips * sizeof(u32),
 			     lnet_acceptor_timeout());
 	if (rc) {
-		CNETERR("Error %d sending HELLO payload (%d) to %pI4h/%d\n",
+		CNETERR("Error %d sending HELLO payload (%d) to %pISp\n",
 			rc, hello->kshm_nips,
-			&conn->ksnc_ipaddr, conn->ksnc_port);
+			&conn->ksnc_peeraddr);
 	}
 
 	return rc;
@@ -581,17 +581,17 @@
 			    sizeof(*hdr) - offsetof(struct lnet_hdr, src_nid),
 			    timeout);
 	if (rc) {
-		CERROR("Error %d reading rest of HELLO hdr from %pI4h\n",
-		       rc, &conn->ksnc_ipaddr);
+		CERROR("Error %d reading rest of HELLO hdr from %pIS\n",
+		       rc, &conn->ksnc_peeraddr);
 		LASSERT(rc < 0 && rc != -EALREADY);
 		goto out;
 	}
 
 	/* ...and check we got what we expected */
 	if (hdr->type != cpu_to_le32(LNET_MSG_HELLO)) {
-		CERROR("Expecting a HELLO hdr, but got type %d from %pI4h\n",
+		CERROR("Expecting a HELLO hdr, but got type %d from %pIS\n",
 		       le32_to_cpu(hdr->type),
-		       &conn->ksnc_ipaddr);
+		       &conn->ksnc_peeraddr);
 		rc = -EPROTO;
 		goto out;
 	}
@@ -603,8 +603,8 @@
 	hello->kshm_nips = le32_to_cpu(hdr->payload_length) / sizeof(u32);
 
 	if (hello->kshm_nips > LNET_INTERFACES_NUM) {
-		CERROR("Bad nips %d from ip %pI4h\n",
-		       hello->kshm_nips, &conn->ksnc_ipaddr);
+		CERROR("Bad nips %d from ip %pIS\n",
+		       hello->kshm_nips, &conn->ksnc_peeraddr);
 		rc = -EPROTO;
 		goto out;
 	}
@@ -615,8 +615,8 @@
 	rc = lnet_sock_read(sock, hello->kshm_ips,
 			    hello->kshm_nips * sizeof(u32), timeout);
 	if (rc) {
-		CERROR("Error %d reading IPs from ip %pI4h\n",
-		       rc, &conn->ksnc_ipaddr);
+		CERROR("Error %d reading IPs from ip %pIS\n",
+		       rc, &conn->ksnc_peeraddr);
 		LASSERT(rc < 0 && rc != -EALREADY);
 		goto out;
 	}
@@ -625,8 +625,8 @@
 		hello->kshm_ips[i] = __le32_to_cpu(hello->kshm_ips[i]);
 
 		if (!hello->kshm_ips[i]) {
-			CERROR("Zero IP[%d] from ip %pI4h\n",
-			       i, &conn->ksnc_ipaddr);
+			CERROR("Zero IP[%d] from ip %pIS\n",
+			       i, &conn->ksnc_peeraddr);
 			rc = -EPROTO;
 			break;
 		}
@@ -655,8 +655,8 @@
 				     offsetof(struct ksock_hello_msg, kshm_src_nid),
 			    timeout);
 	if (rc) {
-		CERROR("Error %d reading HELLO from %pI4h\n",
-		       rc, &conn->ksnc_ipaddr);
+		CERROR("Error %d reading HELLO from %pIS\n",
+		       rc, &conn->ksnc_peeraddr);
 		LASSERT(rc < 0 && rc != -EALREADY);
 		return rc;
 	}
@@ -673,8 +673,8 @@
 	}
 
 	if (hello->kshm_nips > LNET_INTERFACES_NUM) {
-		CERROR("Bad nips %d from ip %pI4h\n",
-		       hello->kshm_nips, &conn->ksnc_ipaddr);
+		CERROR("Bad nips %d from ip %pIS\n",
+		       hello->kshm_nips, &conn->ksnc_peeraddr);
 		return -EPROTO;
 	}
 
@@ -684,8 +684,8 @@
 	rc = lnet_sock_read(sock, hello->kshm_ips,
 			    hello->kshm_nips * sizeof(u32), timeout);
 	if (rc) {
-		CERROR("Error %d reading IPs from ip %pI4h\n",
-		       rc, &conn->ksnc_ipaddr);
+		CERROR("Error %d reading IPs from ip %pIS\n",
+		       rc, &conn->ksnc_peeraddr);
 		LASSERT(rc < 0 && rc != -EALREADY);
 		return rc;
 	}
@@ -695,8 +695,8 @@
 			__swab32s(&hello->kshm_ips[i]);
 
 		if (!hello->kshm_ips[i]) {
-			CERROR("Zero IP[%d] from ip %pI4h\n",
-			       i, &conn->ksnc_ipaddr);
+			CERROR("Zero IP[%d] from ip %pIS\n",
+			       i, &conn->ksnc_peeraddr);
 			return -EPROTO;
 		}
 	}
diff --git a/net/lnet/lnet/acceptor.c b/net/lnet/lnet/acceptor.c
index 55c056f..5765a08 100644
--- a/net/lnet/lnet/acceptor.c
+++ b/net/lnet/lnet/acceptor.c
@@ -35,6 +35,7 @@
 #include <linux/completion.h>
 #include <net/sock.h>
 #include <linux/lnet/lib-lnet.h>
+#include <linux/sunrpc/addr.h>
 
 static int accept_port = 988;
 static int accept_backlog = 127;
@@ -86,53 +87,51 @@
 
 void
 lnet_connect_console_error(int rc, lnet_nid_t peer_nid,
-			   u32 peer_ip, int peer_port)
+			   struct sockaddr *sa)
 {
 	switch (rc) {
 	/* "normal" errors */
 	case -ECONNREFUSED:
-		CNETERR("Connection to %s at host %pI4h on port %d was refused: check that Lustre is running on that node.\n",
-			libcfs_nid2str(peer_nid),
-			&peer_ip, peer_port);
+		CNETERR("Connection to %s at host %pISp was refused: check that Lustre is running on that node.\n",
+			libcfs_nid2str(peer_nid), sa);
 		break;
 	case -EHOSTUNREACH:
 	case -ENETUNREACH:
-		CNETERR("Connection to %s at host %pI4h was unreachable: the network or that node may be down, or Lustre may be misconfigured.\n",
-			libcfs_nid2str(peer_nid), &peer_ip);
+		CNETERR("Connection to %s at host %pIS was unreachable: the network or that node may be down, or Lustre may be misconfigured.\n",
+			libcfs_nid2str(peer_nid), sa);
 		break;
 	case -ETIMEDOUT:
-		CNETERR("Connection to %s at host %pI4h on port %d took too long: that node may be hung or experiencing high load.\n",
-			libcfs_nid2str(peer_nid),
-			&peer_ip, peer_port);
+		CNETERR("Connection to %s at host %pISp took too long: that node may be hung or experiencing high load.\n",
+			libcfs_nid2str(peer_nid), sa);
 		break;
 	case -ECONNRESET:
-		LCONSOLE_ERROR_MSG(0x11b, "Connection to %s at host %pI4h on port %d was reset: is it running a compatible version of Lustre and is %s one of its NIDs?\n",
-				   libcfs_nid2str(peer_nid),
-				   &peer_ip, peer_port,
+		LCONSOLE_ERROR_MSG(0x11b,
+				   "Connection to %s at host %pISp was reset: is it running a compatible version of Lustre and is %s one of its NIDs?\n",
+				   libcfs_nid2str(peer_nid), sa,
 				   libcfs_nid2str(peer_nid));
 		break;
 	case -EPROTO:
-		LCONSOLE_ERROR_MSG(0x11c, "Protocol error connecting to %s at host %pI4h on port %d: is it running a compatible version of Lustre?\n",
-				   libcfs_nid2str(peer_nid),
-				   &peer_ip, peer_port);
+		LCONSOLE_ERROR_MSG(0x11c,
+				   "Protocol error connecting to %s at host %pISp: is it running a compatible version of Lustre?\n",
+				   libcfs_nid2str(peer_nid), sa);
 		break;
 	case -EADDRINUSE:
-		LCONSOLE_ERROR_MSG(0x11d, "No privileged ports available to connect to %s at host %pI4h on port %d\n",
-				   libcfs_nid2str(peer_nid),
-				   &peer_ip, peer_port);
+		LCONSOLE_ERROR_MSG(0x11d,
+				   "No privileged ports available to connect to %s at host %pISp\n",
+				   libcfs_nid2str(peer_nid), sa);
 		break;
 	default:
-		LCONSOLE_ERROR_MSG(0x11e, "Unexpected error %d connecting to %s at host %pI4h on port %d\n",
-				   rc, libcfs_nid2str(peer_nid),
-				   &peer_ip, peer_port);
+		LCONSOLE_ERROR_MSG(0x11e,
+				   "Unexpected error %d connecting to %s at host %pISp\n",
+				   rc, libcfs_nid2str(peer_nid), sa);
 		break;
 	}
 }
 EXPORT_SYMBOL(lnet_connect_console_error);
 
 struct socket *
-lnet_connect(lnet_nid_t peer_nid, int interface, u32 peer_ip,
-	     int peer_port, struct net *ns)
+lnet_connect(lnet_nid_t peer_nid, int interface, struct sockaddr *peeraddr,
+	     struct net *ns)
 {
 	struct lnet_acceptor_connreq cr;
 	struct socket *sock;
@@ -141,16 +140,13 @@ struct socket *
 
 	BUILD_BUG_ON(sizeof(cr) > 16);		/* too big to be on the stack */
 
+	LASSERT(peeraddr->sa_family == AF_INET);
+
 	for (port = LNET_ACCEPTOR_MAX_RESERVED_PORT;
 	     port >= LNET_ACCEPTOR_MIN_RESERVED_PORT;
 	     --port) {
 		/* Iterate through reserved ports. */
-		struct sockaddr_in paddr = { .sin_family = AF_INET };
-
-		paddr.sin_addr.s_addr = htonl(peer_ip);
-		paddr.sin_port = htons(peer_port);
-		sock = lnet_sock_connect(interface, port,
-					 (struct sockaddr *)&paddr, ns);
+		sock = lnet_sock_connect(interface, port, peeraddr, ns);
 		if (IS_ERR(sock)) {
 			rc = PTR_ERR(sock);
 			if (rc == -EADDRINUSE || rc == -EADDRNOTAVAIL)
@@ -186,7 +182,7 @@ struct socket *
 failed_sock:
 	sock_release(sock);
 failed:
-	lnet_connect_console_error(rc, peer_nid, peer_ip, peer_port);
+	lnet_connect_console_error(rc, peer_nid, peeraddr);
 	return ERR_PTR(rc);
 }
 EXPORT_SYMBOL(lnet_connect);
@@ -195,8 +191,7 @@ struct socket *
 lnet_accept(struct socket *sock, u32 magic)
 {
 	struct lnet_acceptor_connreq cr;
-	u32 peer_ip;
-	int peer_port;
+	struct sockaddr_storage peer;
 	int rc;
 	int flip;
 	struct lnet_ni *ni;
@@ -204,7 +199,7 @@ struct socket *
 
 	LASSERT(sizeof(cr) <= 16);		/* not too big for the stack */
 
-	rc = lnet_sock_getaddr(sock, 1, &peer_ip, &peer_port);
+	rc = lnet_sock_getaddr(sock, true, &peer);
 	LASSERT(!rc);				/* we succeeded before */
 
 	if (!lnet_accept_magic(magic, LNET_PROTO_ACCEPTOR_MAGIC)) {
@@ -222,8 +217,8 @@ struct socket *
 					     accept_timeout);
 
 			if (rc)
-				CERROR("Error sending magic+version in response to LNET magic from %pI4h: %d\n",
-				       &peer_ip, rc);
+				CERROR("Error sending magic+version in response to LNET magic from %pIS: %d\n",
+				       &peer, rc);
 			return -EPROTO;
 		}
 
@@ -232,8 +227,9 @@ struct socket *
 		else
 			str = "unrecognised";
 
-		LCONSOLE_ERROR_MSG(0x11f, "Refusing connection from %pI4h magic %08x: %s acceptor protocol\n",
-				   &peer_ip, magic, str);
+		LCONSOLE_ERROR_MSG(0x11f,
+				   "Refusing connection from %pIS magic %08x: %s acceptor protocol\n",
+				   &peer, magic, str);
 		return -EPROTO;
 	}
 
@@ -242,8 +238,8 @@ struct socket *
 	rc = lnet_sock_read(sock, &cr.acr_version, sizeof(cr.acr_version),
 			    accept_timeout);
 	if (rc) {
-		CERROR("Error %d reading connection request version from %pI4h\n",
-		       rc, &peer_ip);
+		CERROR("Error %d reading connection request version from %pIS\n",
+		       rc, &peer);
 		return -EIO;
 	}
 
@@ -265,8 +261,8 @@ struct socket *
 
 		rc = lnet_sock_write(sock, &cr, sizeof(cr), accept_timeout);
 		if (rc)
-			CERROR("Error sending magic+version in response to version %d from %pI4h: %d\n",
-			       peer_version, &peer_ip, rc);
+			CERROR("Error sending magic+version in response to version %d from %pIS: %d\n",
+			       peer_version, &peer, rc);
 		return -EPROTO;
 	}
 
@@ -275,8 +271,8 @@ struct socket *
 			    offsetof(struct lnet_acceptor_connreq, acr_nid),
 			    accept_timeout);
 	if (rc) {
-		CERROR("Error %d reading connection request from %pI4h\n",
-		       rc, &peer_ip);
+		CERROR("Error %d reading connection request from %pIS\n",
+		       rc, &peer);
 		return -EIO;
 	}
 
@@ -288,21 +284,23 @@ struct socket *
 	    ni->ni_nid != cr.acr_nid) { /* right NET, wrong NID! */
 		if (ni)
 			lnet_ni_decref(ni);
-		LCONSOLE_ERROR_MSG(0x120, "Refusing connection from %pI4h for %s: No matching NI\n",
-				   &peer_ip, libcfs_nid2str(cr.acr_nid));
+		LCONSOLE_ERROR_MSG(0x120,
+				   "Refusing connection from %pIS for %s: No matching NI\n",
+				   &peer, libcfs_nid2str(cr.acr_nid));
 		return -EPERM;
 	}
 
 	if (!ni->ni_net->net_lnd->lnd_accept) {
 		/* This catches a request for the loopback LND */
 		lnet_ni_decref(ni);
-		LCONSOLE_ERROR_MSG(0x121, "Refusing connection from %pI4h for %s: NI doesn not accept IP connections\n",
-				   &peer_ip, libcfs_nid2str(cr.acr_nid));
+		LCONSOLE_ERROR_MSG(0x121,
+				   "Refusing connection from %pIS for %s: NI doesn not accept IP connections\n",
+				   &peer, libcfs_nid2str(cr.acr_nid));
 		return -EPERM;
 	}
 
-	CDEBUG(D_NET, "Accept %s from %pI4h\n",
-	       libcfs_nid2str(cr.acr_nid), &peer_ip);
+	CDEBUG(D_NET, "Accept %s from %pIS\n",
+	       libcfs_nid2str(cr.acr_nid), &peer);
 
 	rc = ni->ni_net->net_lnd->lnd_accept(ni, sock);
 
@@ -326,8 +324,7 @@ static void lnet_acceptor_ready(struct sock *sk)
 	struct socket *newsock;
 	int rc;
 	u32 magic;
-	u32 peer_ip;
-	int peer_port;
+	struct sockaddr_storage peer;
 	int secure = (int)((long)arg);
 
 	LASSERT(!lnet_acceptor_state.pta_sock);
@@ -387,23 +384,25 @@ static void lnet_acceptor_ready(struct sock *sk)
 		/* make sure we call lnet_sock_accept() again, until it fails */
 		atomic_set(&lnet_acceptor_state.pta_ready, 1);
 
-		rc = lnet_sock_getaddr(newsock, 1, &peer_ip, &peer_port);
+		rc = lnet_sock_getaddr(newsock, true, &peer);
 		if (rc) {
 			CERROR("Can't determine new connection's address\n");
 			goto failed;
 		}
 
-		if (secure && peer_port > LNET_ACCEPTOR_MAX_RESERVED_PORT) {
-			CERROR("Refusing connection from %pI4h: insecure port %d\n",
-			       &peer_ip, peer_port);
+		if (secure &&
+		    rpc_get_port((struct sockaddr *)&peer) >
+		    LNET_ACCEPTOR_MAX_RESERVED_PORT) {
+			CERROR("Refusing connection from %pISp: insecure port\n",
+			       &peer);
 			goto failed;
 		}
 
 		rc = lnet_sock_read(newsock, &magic, sizeof(magic),
 				    accept_timeout);
 		if (rc) {
-			CERROR("Error %d reading connection request from %pI4h\n",
-			       rc, &peer_ip);
+			CERROR("Error %d reading connection request from %pIS\n",
+			       rc, &peer);
 			goto failed;
 		}
 
diff --git a/net/lnet/lnet/lib-socket.c b/net/lnet/lnet/lib-socket.c
index e082b52..5c5366f 100644
--- a/net/lnet/lnet/lib-socket.c
+++ b/net/lnet/lnet/lib-socket.c
@@ -267,27 +267,21 @@ int choose_ipv4_src(__u32 *ret, int interface, __u32 dst_ipaddr, struct net *ns)
 EXPORT_SYMBOL(lnet_sock_setbuf);
 
 int
-lnet_sock_getaddr(struct socket *sock, bool remote, u32 *ip, int *port)
+lnet_sock_getaddr(struct socket *sock, bool remote,
+		  struct sockaddr_storage *peer)
 {
-	struct sockaddr_in sin;
 	int rc;
 
 	if (remote)
-		rc = kernel_getpeername(sock, (struct sockaddr *)&sin);
+		rc = kernel_getpeername(sock, (struct sockaddr *)peer);
 	else
-		rc = kernel_getsockname(sock, (struct sockaddr *)&sin);
+		rc = kernel_getsockname(sock, (struct sockaddr *)peer);
 	if (rc < 0) {
 		CERROR("Error %d getting sock %s IP/port\n",
 		       rc, remote ? "peer" : "local");
 		return rc;
 	}
 
-	if (ip)
-		*ip = ntohl(sin.sin_addr.s_addr);
-
-	if (port)
-		*port = ntohs(sin.sin_port);
-
 	return 0;
 }
 EXPORT_SYMBOL(lnet_sock_getaddr);
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 02/29] lnet: allow creation of IPv6 socket.
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 01/29] lnet: socklnd: use sockaddr instead of u32 addresses James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 03/29] lnet: allow lnet_connect() to use IPv6 addresses James Simmons
                   ` (26 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Mr NeilBrown <neilb@suse.de>

With this patch, lnet_sock_create() can make IPv6 sockets.  If an
interface and destination is given, completely different code is
needed to bind the local address.

When no interface or destination is given, an IPv6 socket is always
created, so lnet_acceptor() needs to request that IPv4 connections are
accepted as well, and lnet_sock_getaddr() needs to detect mapped v4
addresses and present them as true v4 addresses.

WC-bug-id: https://jira.whamcloud.com/browse/LU-10391
Lustre-commit: e4fa181abf103219 ("LU-10391 lnet: allow creation of IPv6 socket.")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/37705
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/lnet/lib-socket.c | 85 +++++++++++++++++++++++++++++++++++-----------
 1 file changed, 65 insertions(+), 20 deletions(-)

diff --git a/net/lnet/lnet/lib-socket.c b/net/lnet/lnet/lib-socket.c
index 5c5366f..eb6559c 100644
--- a/net/lnet/lnet/lib-socket.c
+++ b/net/lnet/lnet/lib-socket.c
@@ -35,6 +35,8 @@
 #include <linux/if.h>
 #include <linux/in.h>
 #include <linux/net.h>
+#include <net/addrconf.h>
+#include <net/ipv6.h>
 #include <linux/file.h>
 #include <linux/pagemap.h>
 /* For sys_open & sys_close */
@@ -141,7 +143,7 @@
 }
 EXPORT_SYMBOL(lnet_sock_read);
 
-int choose_ipv4_src(__u32 *ret, int interface, __u32 dst_ipaddr, struct net *ns)
+int choose_ipv4_src(u32 *ret, int interface, u32 dst_ipaddr, struct net *ns)
 {
 	struct net_device *dev;
 	struct in_device *in_dev;
@@ -181,8 +183,12 @@ int choose_ipv4_src(__u32 *ret, int interface, __u32 dst_ipaddr, struct net *ns)
 	struct socket *sock;
 	int rc;
 	int option;
+	int family;
 
-	rc = sock_create_kern(ns, PF_INET, SOCK_STREAM, 0, &sock);
+	family = AF_INET6;
+	if (remaddr)
+		family = remaddr->sa_family;
+	rc = sock_create_kern(ns, family, SOCK_STREAM, 0, &sock);
 	if (rc) {
 		CERROR("Can't create socket: %d\n", rc);
 		return ERR_PTR(rc);
@@ -197,25 +203,44 @@ int choose_ipv4_src(__u32 *ret, int interface, __u32 dst_ipaddr, struct net *ns)
 	}
 
 	if (interface >= 0 || local_port) {
-		struct sockaddr_in locaddr = {};
-
-		locaddr.sin_family = AF_INET;
-		locaddr.sin_addr.s_addr = INADDR_ANY;
-		if (interface >= 0) {
-			struct sockaddr_in *sin = (void *)remaddr;
-			u32 ip;
-
-			rc = choose_ipv4_src(&ip,
-					     interface,
-					     ntohl(sin->sin_addr.s_addr),
-					     ns);
-			if (rc)
-				goto failed;
-			locaddr.sin_addr.s_addr = htonl(ip);
+		struct sockaddr_storage locaddr = {};
+		struct sockaddr_in *sin = (void *)&locaddr;
+		struct sockaddr_in6 *sin6 = (void *)&locaddr;
+
+		switch (family) {
+		case AF_INET:
+			sin->sin_family = AF_INET;
+			sin->sin_addr.s_addr = INADDR_ANY;
+			if (interface >= 0 && remaddr) {
+				struct sockaddr_in *rem = (void *)remaddr;
+				u32 ip;
+
+				rc = choose_ipv4_src(&ip,
+						     interface,
+						     ntohl(rem->sin_addr.s_addr),
+						     ns);
+				if (rc)
+					goto failed;
+				sin->sin_addr.s_addr = htonl(ip);
+			}
+			sin->sin_port = htons(local_port);
+			break;
+		case AF_INET6:
+			sin6->sin6_family = AF_INET6;
+			sin6->sin6_addr = in6addr_any;
+			if (interface >= 0 && remaddr) {
+				struct sockaddr_in6 *rem = (void *)remaddr;
+
+				ipv6_dev_get_saddr(ns,
+						   dev_get_by_index(ns,
+								    interface),
+						   &rem->sin6_addr, 0,
+						   &sin6->sin6_addr);
+			}
+			sin6->sin6_port = htons(local_port);
+			break;
 		}
 
-		locaddr.sin_port = htons(local_port);
-
 		rc = kernel_bind(sock, (struct sockaddr *)&locaddr,
 				 sizeof(locaddr));
 		if (rc == -EADDRINUSE) {
@@ -281,7 +306,19 @@ int choose_ipv4_src(__u32 *ret, int interface, __u32 dst_ipaddr, struct net *ns)
 		       rc, remote ? "peer" : "local");
 		return rc;
 	}
-
+	if (peer->ss_family == AF_INET6) {
+		struct sockaddr_in6 *in6 = (void *)peer;
+		struct sockaddr_in *in = (void *)peer;
+		short port = in6->sin6_port;
+
+		if (ipv6_addr_v4mapped(&in6->sin6_addr)) {
+			/* Pretend it is a v4 socket */
+			memset(in, 0, sizeof(*in));
+			in->sin_family = AF_INET;
+			in->sin_port = port;
+			memcpy(&in->sin_addr, &in6->sin6_addr.s6_addr32[3], 4);
+		}
+	}
 	return 0;
 }
 EXPORT_SYMBOL(lnet_sock_getaddr);
@@ -303,6 +340,7 @@ struct socket *
 lnet_sock_listen(int local_port, int backlog, struct net *ns)
 {
 	struct socket *sock;
+	int val = 0;
 	int rc;
 
 	sock = lnet_sock_create(-1, NULL, local_port, ns);
@@ -314,6 +352,13 @@ struct socket *
 		return ERR_PTR(rc);
 	}
 
+	/* Make sure we get both IPv4 and IPv6 connections.
+	 * This is the default, but it can be overridden so
+	 * we force it back.
+	 */
+	kernel_setsockopt(sock, IPPROTO_IPV6, IPV6_V6ONLY,
+			  (char *)&val, sizeof(val));
+
 	rc = kernel_listen(sock, backlog);
 	if (!rc)
 		return sock;
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 03/29] lnet: allow lnet_connect() to use IPv6 addresses
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 01/29] lnet: socklnd: use sockaddr instead of u32 addresses James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 02/29] lnet: allow creation of IPv6 socket James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 04/29] lnet: handle possiblity of IPv6 being unavailable James Simmons
                   ` (25 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Mr NeilBrown <neilb@suse.de>

Now that we can created and bind IPv6 sockets, connecting to them is
trivial.

WC-bug-id: https://jira.whamcloud.com/browse/LU-10391
Lustre-commit: fb40f0b62d77d69 ("LU-10391 lnet: allow lnet_connect() to use IPv6 addresses.")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/37706
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/lnet/acceptor.c   | 3 ++-
 net/lnet/lnet/lib-socket.c | 2 +-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/net/lnet/lnet/acceptor.c b/net/lnet/lnet/acceptor.c
index 5765a08..d326e39 100644
--- a/net/lnet/lnet/acceptor.c
+++ b/net/lnet/lnet/acceptor.c
@@ -140,7 +140,8 @@ struct socket *
 
 	BUILD_BUG_ON(sizeof(cr) > 16);		/* too big to be on the stack */
 
-	LASSERT(peeraddr->sa_family == AF_INET);
+	LASSERT(peeraddr->sa_family == AF_INET ||
+		peeraddr->sa_family == AF_INET6);
 
 	for (port = LNET_ACCEPTOR_MAX_RESERVED_PORT;
 	     port >= LNET_ACCEPTOR_MIN_RESERVED_PORT;
diff --git a/net/lnet/lnet/lib-socket.c b/net/lnet/lnet/lib-socket.c
index eb6559c..ee675ae 100644
--- a/net/lnet/lnet/lib-socket.c
+++ b/net/lnet/lnet/lib-socket.c
@@ -380,7 +380,7 @@ struct socket *
 	if (IS_ERR(sock))
 		return sock;
 
-	rc = kernel_connect(sock, peeraddr, sizeof(struct sockaddr_in), 0);
+	rc = kernel_connect(sock, peeraddr, sizeof(struct sockaddr_in6), 0);
 	if (!rc)
 		return sock;
 
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 04/29] lnet: handle possiblity of IPv6 being unavailable.
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (2 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 03/29] lnet: allow lnet_connect() to use IPv6 addresses James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 05/29] lnet: socklnd: remove tcp bonding James Simmons
                   ` (24 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Mr NeilBrown <neilb@suse.de>

If CONFIG_IPV6 is not enabled, the attempt to create an IPv6 socket
for accepting new incoming connections will fail.  In that case
we need to creae an IPv4 socket instead.

Also ipv6_dev_get_saddr will not be available, so we must not include
the code that tries to use it.

Fixes: 7314102c80ae ("lnet: allow creation of IPv6 socket")
WC-bug-id: https://jira.whamcloud.com/browse/LU-14477
Lustre-commit: 6376551ca266f839 ("LU-14477 lnet: handle possiblity of IPv6 being unavailable.")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/41791
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/lnet/lib-socket.c | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/net/lnet/lnet/lib-socket.c b/net/lnet/lnet/lib-socket.c
index ee675ae..317d3cf 100644
--- a/net/lnet/lnet/lib-socket.c
+++ b/net/lnet/lnet/lib-socket.c
@@ -188,7 +188,13 @@ int choose_ipv4_src(u32 *ret, int interface, u32 dst_ipaddr, struct net *ns)
 	family = AF_INET6;
 	if (remaddr)
 		family = remaddr->sa_family;
+retry:
 	rc = sock_create_kern(ns, family, SOCK_STREAM, 0, &sock);
+	if (rc == -EAFNOSUPPORT && family == AF_INET6 && !remaddr) {
+		family = AF_INET;
+		goto retry;
+	}
+
 	if (rc) {
 		CERROR("Can't create socket: %d\n", rc);
 		return ERR_PTR(rc);
@@ -204,11 +210,11 @@ int choose_ipv4_src(u32 *ret, int interface, u32 dst_ipaddr, struct net *ns)
 
 	if (interface >= 0 || local_port) {
 		struct sockaddr_storage locaddr = {};
-		struct sockaddr_in *sin = (void *)&locaddr;
-		struct sockaddr_in6 *sin6 = (void *)&locaddr;
 
 		switch (family) {
-		case AF_INET:
+		case AF_INET: {
+			struct sockaddr_in *sin = (void *)&locaddr;
+
 			sin->sin_family = AF_INET;
 			sin->sin_addr.s_addr = INADDR_ANY;
 			if (interface >= 0 && remaddr) {
@@ -225,7 +231,11 @@ int choose_ipv4_src(u32 *ret, int interface, u32 dst_ipaddr, struct net *ns)
 			}
 			sin->sin_port = htons(local_port);
 			break;
-		case AF_INET6:
+		}
+#if IS_ENABLED(CONFIG_IPV6)
+		case AF_INET6: {
+			struct sockaddr_in6 *sin6 = (void *)&locaddr;
+
 			sin6->sin6_family = AF_INET6;
 			sin6->sin6_addr = in6addr_any;
 			if (interface >= 0 && remaddr) {
@@ -240,6 +250,8 @@ int choose_ipv4_src(u32 *ret, int interface, u32 dst_ipaddr, struct net *ns)
 			sin6->sin6_port = htons(local_port);
 			break;
 		}
+#endif /* IS_ENABLED(CONFIG_IPV6) */
+		}
 
 		rc = kernel_bind(sock, (struct sockaddr *)&locaddr,
 				 sizeof(locaddr));
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 05/29] lnet: socklnd: remove tcp bonding
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (3 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 04/29] lnet: handle possiblity of IPv6 being unavailable James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 06/29] lnet: socklnd: replace route construct James Simmons
                   ` (23 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown
  Cc: Serguei Smirnov, Lustre Development List

From: Serguei Smirnov <ssmirnov@whamcloud.com>

TCP bonding in the socklnd has become obsolete with LNet
Multi-Rail and there's no evidence it's being used anywhere.
Remove it to keep the code simple.

WC-bug-id: https://jira.whamcloud.com/browse/LU-13641
Lustre-commit: d123c47a18adbf56 ("LU-13641 socklnd: remove tcp bonding")
Signed-off-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/40000
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 include/linux/lnet/lib-lnet.h      |   3 +-
 include/linux/lnet/lib-types.h     |   5 +-
 include/uapi/linux/lnet/lnet-dlc.h |   5 +-
 net/lnet/klnds/o2iblnd/o2iblnd.c   |  16 +-
 net/lnet/klnds/socklnd/socklnd.c   | 683 +++----------------------------------
 net/lnet/klnds/socklnd/socklnd.h   |   3 +-
 net/lnet/lnet/api-ni.c             |  58 +---
 net/lnet/lnet/config.c             |  58 +---
 8 files changed, 91 insertions(+), 740 deletions(-)

diff --git a/include/linux/lnet/lib-lnet.h b/include/linux/lnet/lib-lnet.h
index 2e88d80..4712e2d 100644
--- a/include/linux/lnet/lib-lnet.h
+++ b/include/linux/lnet/lib-lnet.h
@@ -793,8 +793,7 @@ int lnet_push_target_post(struct lnet_ping_buffer *pbuf,
 
 int lnet_parse_ip2nets(const char **networksp, const char *ip2nets);
 int lnet_parse_routes(const char *route_str, int *im_a_router);
-int lnet_parse_networks(struct list_head *nilist, const char *networks,
-			bool use_tcp_bonding);
+int lnet_parse_networks(struct list_head *nilist, const char *networks);
 bool lnet_net_unique(u32 net_id, struct list_head *nilist,
 		     struct lnet_net **net);
 bool lnet_ni_unique_net(struct list_head *nilist, char *iface);
diff --git a/include/linux/lnet/lib-types.h b/include/linux/lnet/lib-types.h
index ce067b3..f479efe 100644
--- a/include/linux/lnet/lib-types.h
+++ b/include/linux/lnet/lib-types.h
@@ -496,10 +496,9 @@ struct lnet_ni {
 	u32			ni_sel_priority;
 
 	/*
-	 * equivalent interfaces to use
-	 * This is an array because socklnd bonding can still be configured
+	 * equivalent interface to use
 	 */
-	char			*ni_interfaces[LNET_INTERFACES_NUM];
+	char			*ni_interface;
 	/* original net namespace */
 	struct net		*ni_net_ns;
 };
diff --git a/include/uapi/linux/lnet/lnet-dlc.h b/include/uapi/linux/lnet/lnet-dlc.h
index e775dfe..b375d0a 100644
--- a/include/uapi/linux/lnet/lnet-dlc.h
+++ b/include/uapi/linux/lnet/lnet-dlc.h
@@ -93,7 +93,7 @@ struct lnet_ioctl_config_lnd_tunables {
 };
 
 struct lnet_ioctl_net_config {
-	char ni_interfaces[LNET_INTERFACES_NUM][LNET_MAX_STR_LEN];
+	char ni_interface[LNET_MAX_STR_LEN];
 	__u32 ni_status;
 	__u32 ni_cpts[LNET_MAX_SHOW_NUM_CPT];
 	char cfg_bulk[0];
@@ -222,12 +222,11 @@ struct lnet_ioctl_element_msg_stats {
 struct lnet_ioctl_config_ni {
 	struct libcfs_ioctl_hdr lic_cfg_hdr;
 	lnet_nid_t		lic_nid;
-	char			lic_ni_intf[LNET_INTERFACES_NUM][LNET_MAX_STR_LEN];
+	char			lic_ni_intf[LNET_MAX_STR_LEN];
 	char			lic_legacy_ip2nets[LNET_MAX_STR_LEN];
 	__u32			lic_cpts[LNET_MAX_SHOW_NUM_CPT];
 	__u32			lic_ncpts;
 	__u32			lic_status;
-	__u32			lic_tcp_bonding;
 	__u32			lic_idx;
 	__s32			lic_dev_cpt;
 	char			pad[4];
diff --git a/net/lnet/klnds/o2iblnd/o2iblnd.c b/net/lnet/klnds/o2iblnd/o2iblnd.c
index 01cc1ed..782e29b 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/net/lnet/klnds/o2iblnd/o2iblnd.c
@@ -2822,20 +2822,12 @@ static int kiblnd_startup(struct lnet_ni *ni)
 	if (rc)
 		goto net_failed;
 
-	/* ni_interfaces is only to support legacy pre Multi-Rail
-	 * tcp bonding for ksocklnd. Multi-Rail wants each secondary
-	 * IP to be treated as an unique 'struct ni' interfaces instead.
+	/* Multi-Rail wants each secondary
+	 * IP to be treated as an unique 'struct ni' interface.
 	 */
-	if (ni->ni_interfaces[0]) {
+	if (ni->ni_interface) {
 		/* Use the IPoIB interface specified in 'networks=' */
-
-		if (ni->ni_interfaces[1]) {
-			CERROR("ko2iblnd: Multiple interfaces not supported\n");
-			rc = -EINVAL;
-			goto failed;
-		}
-
-		ifname = ni->ni_interfaces[0];
+		ifname = ni->ni_interface;
 	} else {
 		ifname = *kiblnd_tunables.kib_default_ipif;
 	}
diff --git a/net/lnet/klnds/socklnd/socklnd.c b/net/lnet/klnds/socklnd/socklnd.c
index d5fe84d..55d1ba5 100644
--- a/net/lnet/klnds/socklnd/socklnd.c
+++ b/net/lnet/klnds/socklnd/socklnd.c
@@ -50,16 +50,12 @@
 ksocknal_ip2iface(struct lnet_ni *ni, struct sockaddr *addr)
 {
 	struct ksock_net *net = ni->ni_data;
-	int i;
 	struct ksock_interface *iface;
 
-	for (i = 0; i < net->ksnn_ninterfaces; i++) {
-		LASSERT(i < LNET_INTERFACES_NUM);
-		iface = &net->ksnn_interfaces[i];
+	iface = &net->ksnn_interface;
 
-		if (rpc_cmp_addr((struct sockaddr *)&iface->ksni_addr, addr))
-			return iface;
-	}
+	if (rpc_cmp_addr((struct sockaddr *)&iface->ksni_addr, addr))
+		return iface;
 
 	return NULL;
 }
@@ -68,16 +64,12 @@
 ksocknal_index2iface(struct lnet_ni *ni, int index)
 {
 	struct ksock_net *net = ni->ni_data;
-	int i;
 	struct ksock_interface *iface;
 
-	for (i = 0; i < net->ksnn_ninterfaces; i++) {
-		LASSERT(i < LNET_INTERFACES_NUM);
-		iface = &net->ksnn_interfaces[i];
+	iface = &net->ksnn_interface;
 
-		if (iface->ksni_index == index)
-			return iface;
-	}
+	if (iface->ksni_index == index)
+		return iface;
 
 	return NULL;
 }
@@ -436,7 +428,6 @@ struct ksock_peer_ni *
 	LASSERT(!route->ksnr_scheduled);
 	LASSERT(!route->ksnr_connecting);
 	LASSERT(!route->ksnr_connected);
-	LASSERT(net->ksnn_ninterfaces > 0);
 
 	/* LASSERT(unique) */
 	list_for_each_entry(route2, &peer_ni->ksnp_routes, ksnr_list) {
@@ -453,8 +444,8 @@ struct ksock_peer_ni *
 	ksocknal_peer_addref(peer_ni);
 
 	/* set the route's interface to the current net's interface */
-	route->ksnr_myiface = net->ksnn_interfaces[0].ksni_index;
-	net->ksnn_interfaces[0].ksni_nroutes++;
+	route->ksnr_myiface = net->ksnn_interface.ksni_index;
+	net->ksnn_interface.ksni_nroutes++;
 
 	/* peer_ni's routelist takes over my ref on 'route' */
 	list_add_tail(&route->ksnr_list, &peer_ni->ksnp_routes);
@@ -730,332 +721,6 @@ struct ksock_peer_ni *
 	return sched;
 }
 
-static int
-ksocknal_local_ipvec(struct lnet_ni *ni, u32 *ipaddrs)
-{
-	struct ksock_net *net = ni->ni_data;
-	int i, j;
-	int nip;
-
-	read_lock(&ksocknal_data.ksnd_global_lock);
-
-	nip = net->ksnn_ninterfaces;
-	LASSERT(nip <= LNET_INTERFACES_NUM);
-
-	for (i = 0, j = 0; i < nip; i++)
-		if (net->ksnn_interfaces[i].ksni_addr.ss_family == AF_INET) {
-			struct sockaddr_in *sa =
-				(void *)&net->ksnn_interfaces[i].ksni_addr;
-
-			ipaddrs[j] = ntohl(sa->sin_addr.s_addr);
-			LASSERT(ipaddrs[j] != 0);
-			j += 1;
-		}
-	nip = j;
-
-	read_unlock(&ksocknal_data.ksnd_global_lock);
-	/*
-	 * Only offer interfaces for additional connections if I have
-	 * more than one.
-	 */
-	return nip < 2 ? 0 : nip;
-}
-
-static int
-ksocknal_match_peerip(struct ksock_interface *iface, u32 *ips, int nips)
-{
-	int best_netmatch = 0;
-	int best_xor = 0;
-	int best = -1;
-	int this_xor;
-	int this_netmatch;
-	int i;
-	struct sockaddr_in *sa;
-	u32 ip;
-
-	sa = (struct sockaddr_in *)&iface->ksni_addr;
-	LASSERT(sa->sin_family == AF_INET);
-	ip = ntohl(sa->sin_addr.s_addr);
-
-	for (i = 0; i < nips; i++) {
-		if (!ips[i])
-			continue;
-
-		this_xor = ips[i] ^ ip;
-		this_netmatch = !(this_xor & iface->ksni_netmask) ? 1 : 0;
-
-		if (!(best < 0 ||
-		      best_netmatch < this_netmatch ||
-		      (best_netmatch == this_netmatch &&
-		       best_xor > this_xor)))
-			continue;
-
-		best = i;
-		best_netmatch = this_netmatch;
-		best_xor = this_xor;
-	}
-
-	LASSERT(best >= 0);
-	return best;
-}
-
-static int
-ksocknal_select_ips(struct ksock_peer_ni *peer_ni, u32 *peerips, int n_peerips)
-{
-	rwlock_t *global_lock = &ksocknal_data.ksnd_global_lock;
-	struct ksock_net *net = peer_ni->ksnp_ni->ni_data;
-	struct ksock_interface *iface;
-	struct ksock_interface *best_iface;
-	int n_ips;
-	int i;
-	int j;
-	int k;
-	u32 ip;
-	u32 xor;
-	int this_netmatch;
-	int best_netmatch;
-	int best_npeers;
-
-	/*
-	 * CAVEAT EMPTOR: We do all our interface matching with an
-	 * exclusive hold of global lock at IRQ priority.  We're only
-	 * expecting to be dealing with small numbers of interfaces, so the
-	 * O(n**3)-ness shouldn't matter
-	 */
-	/*
-	 * Also note that I'm not going to return more than n_peerips
-	 * interfaces, even if I have more myself
-	 */
-	write_lock_bh(global_lock);
-
-	LASSERT(n_peerips <= LNET_INTERFACES_NUM);
-	LASSERT(net->ksnn_ninterfaces <= LNET_INTERFACES_NUM);
-
-	/*
-	 * Only match interfaces for additional connections
-	 * if I have > 1 interface
-	 */
-	n_ips = (net->ksnn_ninterfaces < 2) ? 0 :
-		min(n_peerips, net->ksnn_ninterfaces);
-
-	for (i = 0; peer_ni->ksnp_n_passive_ips < n_ips; i++) {
-		/*	      ^ yes really... */
-
-		/*
-		 * If we have any new interfaces, first tick off all the
-		 * peer_ni IPs that match old interfaces, then choose new
-		 * interfaces to match the remaining peer_ni IPS.
-		 * We don't forget interfaces we've stopped using; we might
-		 * start using them again...
-		 */
-		if (i < peer_ni->ksnp_n_passive_ips) {
-			/* Old interface. */
-			struct sockaddr_in sa = { .sin_family = AF_INET};
-
-			sa.sin_addr.s_addr =
-				htonl(peer_ni->ksnp_passive_ips[i]);
-			best_iface = ksocknal_ip2iface(peer_ni->ksnp_ni,
-						       (struct sockaddr *)&sa);
-
-			/* peer_ni passive ips are kept up to date */
-			LASSERT(best_iface);
-		} else {
-			/* choose a new interface */
-			struct sockaddr_in *sa;
-
-			LASSERT(i == peer_ni->ksnp_n_passive_ips);
-
-			best_iface = NULL;
-			best_netmatch = 0;
-			best_npeers = 0;
-
-			for (j = 0; j < net->ksnn_ninterfaces; j++) {
-				iface = &net->ksnn_interfaces[j];
-				sa = (void *)&iface->ksni_addr;
-				if (sa->sin_family != AF_INET)
-					continue;
-				ip = ntohl(sa->sin_addr.s_addr);
-
-				for (k = 0;
-				     k < peer_ni->ksnp_n_passive_ips;
-				     k++)
-					if (peer_ni->ksnp_passive_ips[k] == ip)
-						break;
-
-				if (k < peer_ni->ksnp_n_passive_ips)
-					/* using it already */
-					continue;
-
-				k = ksocknal_match_peerip(iface, peerips,
-							  n_peerips);
-				xor = ip ^ peerips[k];
-				this_netmatch = !(xor & iface->ksni_netmask) ? 1 : 0;
-
-				if (!(!best_iface ||
-				      best_netmatch < this_netmatch ||
-				      (best_netmatch == this_netmatch &&
-				       best_npeers > iface->ksni_npeers)))
-					continue;
-
-				best_iface = iface;
-				best_netmatch = this_netmatch;
-				best_npeers = iface->ksni_npeers;
-			}
-
-			LASSERT(best_iface);
-
-			best_iface->ksni_npeers++;
-			sa = (void *)&best_iface->ksni_addr;
-			ip = ntohl(sa->sin_addr.s_addr);
-			peer_ni->ksnp_passive_ips[i] = ip;
-			peer_ni->ksnp_n_passive_ips = i + 1;
-		}
-
-		/* mark the best matching peer_ni IP used */
-		j = ksocknal_match_peerip(best_iface, peerips, n_peerips);
-		peerips[j] = 0;
-	}
-
-	/* Overwrite input peer_ni IP addresses */
-	memcpy(peerips, peer_ni->ksnp_passive_ips, n_ips * sizeof(*peerips));
-
-	write_unlock_bh(global_lock);
-
-	return n_ips;
-}
-
-static void
-ksocknal_create_routes(struct ksock_peer_ni *peer_ni, int port,
-		       u32 *peer_ipaddrs, int npeer_ipaddrs)
-{
-	struct ksock_route *newroute = NULL;
-	rwlock_t *global_lock = &ksocknal_data.ksnd_global_lock;
-	struct lnet_ni *ni = peer_ni->ksnp_ni;
-	struct ksock_net *net = ni->ni_data;
-	struct ksock_route *route;
-	struct ksock_interface *iface;
-	struct ksock_interface *best_iface;
-	int best_netmatch;
-	int this_netmatch;
-	int best_nroutes;
-	int i;
-	int j;
-
-	/*
-	 * CAVEAT EMPTOR: We do all our interface matching with an
-	 * exclusive hold of global lock at IRQ priority.  We're only
-	 * expecting to be dealing with small numbers of interfaces, so the
-	 * O(n**3)-ness here shouldn't matter
-	 */
-	write_lock_bh(global_lock);
-
-	if (net->ksnn_ninterfaces < 2) {
-		/*
-		 * Only create additional connections
-		 * if I have > 1 interface
-		 */
-		write_unlock_bh(global_lock);
-		return;
-	}
-
-	LASSERT(npeer_ipaddrs <= LNET_INTERFACES_NUM);
-
-	for (i = 0; i < npeer_ipaddrs; i++) {
-		if (newroute) {
-			struct sockaddr_in *sa = (void *)&newroute->ksnr_addr;
-
-			memset(sa, 0, sizeof(*sa));
-			sa->sin_family = AF_INET;
-			sa->sin_addr.s_addr = htonl(peer_ipaddrs[i]);
-		} else {
-			struct sockaddr_in sa = {.sin_family = AF_INET};
-
-			write_unlock_bh(global_lock);
-
-			sa.sin_addr.s_addr = htonl(peer_ipaddrs[i]);
-			sa.sin_port = htons(port);
-			newroute =
-				ksocknal_create_route((struct sockaddr *)&sa);
-			if (!newroute)
-				return;
-
-			write_lock_bh(global_lock);
-		}
-
-		if (peer_ni->ksnp_closing) {
-			/* peer_ni got closed under me */
-			break;
-		}
-
-		/* Already got a route? */
-		list_for_each_entry(route, &peer_ni->ksnp_routes, ksnr_list)
-			if (rpc_cmp_addr((struct sockaddr *)&route->ksnr_addr,
-					 (struct sockaddr *)&newroute->ksnr_addr))
-				goto next_ipaddr;
-
-		best_iface = NULL;
-		best_nroutes = 0;
-		best_netmatch = 0;
-
-		LASSERT(net->ksnn_ninterfaces <= LNET_INTERFACES_NUM);
-
-		/* Select interface to connect from */
-		for (j = 0; j < net->ksnn_ninterfaces; j++) {
-			u32 iface_ip, route_ip;
-
-			iface = &net->ksnn_interfaces[j];
-
-			/* Using this interface already? */
-			list_for_each_entry(route, &peer_ni->ksnp_routes,
-					    ksnr_list)
-				if (route->ksnr_myiface == iface->ksni_index)
-					goto next_iface;
-
-			if (iface->ksni_addr.ss_family != AF_INET)
-				continue;
-			if (newroute->ksnr_addr.ss_family != AF_INET)
-				continue;
-
-			iface_ip =
-				ntohl(((struct sockaddr_in *)
-				      &iface->ksni_addr)->sin_addr.s_addr);
-			route_ip =
-				ntohl(((struct sockaddr_in *)
-				      &newroute->ksnr_addr)->sin_addr.s_addr);
-
-			this_netmatch = ((iface_ip ^ route_ip) &
-					  iface->ksni_netmask) ? 1 : 0;
-
-			if (!(!best_iface ||
-			      best_netmatch < this_netmatch ||
-			      (best_netmatch == this_netmatch &&
-			       best_nroutes > iface->ksni_nroutes)))
-				continue;
-
-			best_iface = iface;
-			best_netmatch = this_netmatch;
-			best_nroutes = iface->ksni_nroutes;
-next_iface:
-			;
-		}
-
-		if (!best_iface)
-			continue;
-
-		newroute->ksnr_myiface = best_iface->ksni_index;
-		best_iface->ksni_nroutes++;
-
-		ksocknal_add_route_locked(peer_ni, newroute);
-		newroute = NULL;
-next_ipaddr:
-		;
-	}
-
-	write_unlock_bh(global_lock);
-	if (newroute)
-		ksocknal_route_decref(newroute);
-}
-
 int
 ksocknal_accept(struct lnet_ni *ni, struct socket *sock)
 {
@@ -1177,7 +842,7 @@ struct ksock_peer_ni *
 		LASSERT(ni == peer_ni->ksnp_ni);
 
 		/* Active connection sends HELLO eagerly */
-		hello->kshm_nips = ksocknal_local_ipvec(ni, hello->kshm_ips);
+		hello->kshm_nips =  0;
 		peerid = peer_ni->ksnp_id;
 
 		write_lock_bh(global_lock);
@@ -1422,15 +1087,8 @@ struct ksock_peer_ni *
 	       &conn->ksnc_myaddr, &conn->ksnc_peeraddr,
 	       incarnation, cpt);
 
-	if (active) {
-		struct sockaddr *addr = (struct sockaddr *)&conn->ksnc_peeraddr;
-
-		/* additional routes after interface exchange? */
-		ksocknal_create_routes(peer_ni, rpc_get_port(addr),
-				       hello->kshm_ips, hello->kshm_nips);
-	} else {
-		hello->kshm_nips = ksocknal_select_ips(peer_ni, hello->kshm_ips,
-						       hello->kshm_nips);
+	if (!active) {
+		hello->kshm_nips = 0;
 		rc = ksocknal_send_hello(ni, conn, peerid.nid, hello);
 	}
 
@@ -2001,156 +1659,6 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 	return rc;
 }
 
-static int
-ksocknal_add_interface(struct lnet_ni *ni, u32 ipaddress, u32 netmask)
-{
-	struct ksock_net *net = ni->ni_data;
-	struct ksock_interface *iface;
-	struct sockaddr_in sa = { .sin_family = AF_INET };
-	int rc;
-	int i;
-	int j;
-	struct ksock_peer_ni *peer_ni;
-	struct ksock_route *route;
-
-	if (!ipaddress || !netmask)
-		return -EINVAL;
-
-	write_lock_bh(&ksocknal_data.ksnd_global_lock);
-
-	sa.sin_addr.s_addr = htonl(ipaddress);
-	iface = ksocknal_ip2iface(ni, (struct sockaddr *)&sa);
-	if (iface) {
-		/* silently ignore dups */
-		rc = 0;
-	} else if (net->ksnn_ninterfaces == LNET_INTERFACES_NUM) {
-		rc = -ENOSPC;
-	} else {
-		iface = &net->ksnn_interfaces[net->ksnn_ninterfaces++];
-
-		iface->ksni_index = ksocknal_ip2index((struct sockaddr *)&sa,
-						      ni);
-		rpc_copy_addr((struct sockaddr *)&iface->ksni_addr,
-			      (struct sockaddr *)&sa);
-		iface->ksni_netmask = netmask;
-		iface->ksni_nroutes = 0;
-		iface->ksni_npeers = 0;
-
-		hash_for_each(ksocknal_data.ksnd_peers, i, peer_ni, ksnp_list) {
-			for (j = 0; j < peer_ni->ksnp_n_passive_ips; j++)
-				if (peer_ni->ksnp_passive_ips[j] == ipaddress)
-					iface->ksni_npeers++;
-
-			list_for_each_entry(route, &peer_ni->ksnp_routes,
-					    ksnr_list) {
-				if (route->ksnr_myiface ==
-				    iface->ksni_index)
-					iface->ksni_nroutes++;
-			}
-		}
-
-		rc = 0;
-		/*
-		 * NB only new connections will pay attention to the
-		 * new interface!
-		 */
-	}
-
-	write_unlock_bh(&ksocknal_data.ksnd_global_lock);
-
-	return rc;
-}
-
-static void
-ksocknal_peer_del_interface_locked(struct ksock_peer_ni *peer_ni,
-				   u32 ipaddr, int index)
-{
-	struct ksock_route *route;
-	struct ksock_route *rnxt;
-	struct ksock_conn *conn;
-	struct ksock_conn *cnxt;
-	int i;
-	int j;
-
-	for (i = 0; i < peer_ni->ksnp_n_passive_ips; i++)
-		if (peer_ni->ksnp_passive_ips[i] == ipaddr) {
-			for (j = i + 1; j < peer_ni->ksnp_n_passive_ips; j++)
-				peer_ni->ksnp_passive_ips[j - 1] =
-					peer_ni->ksnp_passive_ips[j];
-			peer_ni->ksnp_n_passive_ips--;
-			break;
-		}
-
-	list_for_each_entry_safe(route, rnxt, &peer_ni->ksnp_routes,
-				 ksnr_list) {
-		if (route->ksnr_myiface != index)
-			continue;
-
-		if (route->ksnr_share_count) {
-			/* Manually created; keep, but unbind */
-			route->ksnr_myiface = -1;
-		} else {
-			ksocknal_del_route_locked(route);
-		}
-	}
-
-	list_for_each_entry_safe(conn, cnxt, &peer_ni->ksnp_conns, ksnc_list)
-		if (conn->ksnc_route->ksnr_myiface == index)
-			ksocknal_close_conn_locked(conn, 0);
-}
-
-static int
-ksocknal_del_interface(struct lnet_ni *ni, u32 ipaddress)
-{
-	struct ksock_net *net = ni->ni_data;
-	int rc = -ENOENT;
-	struct hlist_node *nxt;
-	struct ksock_peer_ni *peer_ni;
-	u32 this_ip;
-	struct sockaddr_in sa = {.sin_family = AF_INET };
-	int index;
-	int i;
-	int j;
-
-	sa.sin_addr.s_addr = htonl(ipaddress);
-	index = ksocknal_ip2index((struct sockaddr *)&sa, ni);
-
-	write_lock_bh(&ksocknal_data.ksnd_global_lock);
-
-	for (i = 0; i < net->ksnn_ninterfaces; i++) {
-		struct sockaddr_in *sa =
-			(void *)&net->ksnn_interfaces[i].ksni_addr;
-
-		if (sa->sin_family != AF_INET)
-			continue;
-		this_ip = ntohl(sa->sin_addr.s_addr);
-
-		if (!(!ipaddress || ipaddress == this_ip))
-			continue;
-
-		rc = 0;
-
-		for (j = i + 1; j < net->ksnn_ninterfaces; j++)
-			net->ksnn_interfaces[j - 1] =
-				net->ksnn_interfaces[j];
-
-		net->ksnn_ninterfaces--;
-
-		hash_for_each_safe(ksocknal_data.ksnd_peers, j,
-				   nxt, peer_ni, ksnp_list) {
-			if (peer_ni->ksnp_ni != ni)
-				continue;
-
-			ksocknal_peer_del_interface_locked(peer_ni,
-							   this_ip, index);
-		}
-	}
-
-	write_unlock_bh(&ksocknal_data.ksnd_global_lock);
-
-	return rc;
-}
-
 int
 ksocknal_ctl(struct lnet_ni *ni, unsigned int cmd, void *arg)
 {
@@ -2166,11 +1674,11 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 
 		read_lock(&ksocknal_data.ksnd_global_lock);
 
-		if (data->ioc_count >= (u32)net->ksnn_ninterfaces) {
+		if (data->ioc_count >= 1) {
 			rc = -ENOENT;
 		} else {
 			rc = 0;
-			iface = &net->ksnn_interfaces[data->ioc_count];
+			iface = &net->ksnn_interface;
 
 			sa = (void *)&iface->ksni_addr;
 			if (sa->sin_family == AF_INET)
@@ -2186,15 +1694,6 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 		return rc;
 	}
 
-	case IOC_LIBCFS_ADD_INTERFACE:
-		return ksocknal_add_interface(ni,
-					      data->ioc_u32[0], /* IP address */
-					      data->ioc_u32[1]); /* net mask */
-
-	case IOC_LIBCFS_DEL_INTERFACE:
-		return ksocknal_del_interface(ni,
-					      data->ioc_u32[0]); /* IP address */
-
 	case IOC_LIBCFS_GET_PEER: {
 		u32 myip = 0;
 		u32 ip = 0;
@@ -2554,7 +2053,6 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 ksocknal_shutdown(struct lnet_ni *ni)
 {
 	struct ksock_net *net = ni->ni_data;
-	int i;
 	struct lnet_process_id anyid = { 0 };
 
 	anyid.nid = LNET_NID_ANY;
@@ -2578,12 +2076,8 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 			       atomic_read(&net->ksnn_npeers) -
 			       SOCKNAL_SHUTDOWN_BIAS);
 
-
-
-	for (i = 0; i < net->ksnn_ninterfaces; i++) {
-		LASSERT(!net->ksnn_interfaces[i].ksni_npeers);
-		LASSERT(!net->ksnn_interfaces[i].ksni_nroutes);
-	}
+	LASSERT(net->ksnn_interface.ksni_npeers == 0);
+	LASSERT(net->ksnn_interface.ksni_nroutes == 0);
 
 	list_del(&net->ksnn_list);
 	kfree(net);
@@ -2596,41 +2090,31 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 static int
 ksocknal_search_new_ipif(struct ksock_net *net)
 {
+	char *ifnam = &net->ksnn_interface.ksni_name[0];
+	char *colon = strchr(ifnam, ':');
+	bool found = false;
+	struct ksock_net *tmp;
 	int new_ipif = 0;
-	int i;
-
-	for (i = 0; i < net->ksnn_ninterfaces; i++) {
-		char *ifnam = &net->ksnn_interfaces[i].ksni_name[0];
-		char *colon = strchr(ifnam, ':');
-		bool found  = false;
-		struct ksock_net *tmp;
-		int j;
 
-		if (colon) /* ignore alias device */
-			*colon = 0;
+	if (colon)
+		*colon = 0;
 
-		list_for_each_entry(tmp, &ksocknal_data.ksnd_nets, ksnn_list) {
-			for (j = 0; !found && j < tmp->ksnn_ninterfaces; j++) {
-				char *ifnam2 =
-					&tmp->ksnn_interfaces[j].ksni_name[0];
-				char *colon2 = strchr(ifnam2, ':');
+	list_for_each_entry(tmp, &ksocknal_data.ksnd_nets, ksnn_list) {
+		char *ifnam2 = &tmp->ksnn_interface.ksni_name[0];
+		char *colon2 = strchr(ifnam2, ':');
 
-				if (colon2)
-					*colon2 = 0;
-
-				found = !strcmp(ifnam, ifnam2);
-				if (colon2)
-					*colon2 = ':';
-			}
-			if (found)
-				break;
-		}
+		if (colon2)
+			*colon2 = 0;
 
-		new_ipif += !found;
-		if (colon)
-			*colon = ':';
+		found = !strcmp(ifnam, ifnam2);
+		if (colon2)
+			*colon2 = ':';
 	}
 
+	new_ipif += !found;
+	if (colon)
+		*colon = ':';
+
 	return new_ipif;
 }
 
@@ -2713,10 +2197,9 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 	struct lnet_ioctl_config_lnd_cmn_tunables *net_tunables;
 	struct ksock_interface *ksi = NULL;
 	struct lnet_inetdev *ifaces = NULL;
+	struct sockaddr_in *sa;
 	int i = 0;
 	int rc;
-	struct net_device *net_dev;
-	int node_id;
 
 	LASSERT(ni->ni_net->net_lnd == &the_ksocklnd);
 
@@ -2759,92 +2242,29 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 	if (rc < 0)
 		goto fail_1;
 
-	if (!ni->ni_interfaces[0]) {
-		struct sockaddr_in *sa;
-
-		ksi = &net->ksnn_interfaces[0];
-		sa = (void *)&ksi->ksni_addr;
-
-		/* Use the first discovered interface */
-		net->ksnn_ninterfaces = 1;
-		ni->ni_dev_cpt = ifaces[0].li_cpt;
-		memset(sa, 0, sizeof(*sa));
-		sa->sin_family = AF_INET;
-		sa->sin_addr.s_addr = htonl(ifaces[0].li_ipaddr);
-		ksi->ksni_index = ksocknal_ip2index((struct sockaddr *)sa, ni);
-		ksi->ksni_netmask = ifaces[0].li_netmask;
-		strlcpy(ksi->ksni_name, ifaces[0].li_name,
-			sizeof(ksi->ksni_name));
-	} else {
-		/* Before Multi-Rail ksocklnd would manage
-		 * multiple interfaces with its own tcp bonding.
-		 * If we encounter an old configuration using
-		 * this tcp bonding approach then we need to
-		 * handle more than one ni_interfaces.
-		 *
-		 * In Multi-Rail configuration only ONE ni_interface
-		 * should exist. Each IP alias should be mapped to
-		 * each 'struct net_ni'.
-		 */
-		for (i = 0; i < LNET_INTERFACES_NUM; i++) {
-			int j;
-
-			if (!ni->ni_interfaces[i])
+	ksi = &net->ksnn_interface;
+	/* Use the first discovered interface or look in the list */
+	if (ni->ni_interface) {
+		for (i = 0; i < rc; i++)
+			if (strcmp(ifaces[i].li_name, ni->ni_interface) == 0)
 				break;
 
-			for (j = 0; j < LNET_INTERFACES_NUM;  j++) {
-				if (i != j && ni->ni_interfaces[j] &&
-				    strcmp(ni->ni_interfaces[i],
-					   ni->ni_interfaces[j]) == 0) {
-					rc = -EEXIST;
-					CERROR("ksocklnd: found duplicate %s at %d and %d, rc = %d\n",
-					       ni->ni_interfaces[i], i, j, rc);
-					goto fail_1;
-				}
-			}
-
-			for (j = 0; j < rc; j++) {
-				struct sockaddr_in *sa;
-
-				if (strcmp(ifaces[j].li_name,
-					   ni->ni_interfaces[i]) != 0)
-					continue;
-
-				ksi = &net->ksnn_interfaces[net->ksnn_ninterfaces];
-				sa = (void *)&ksi->ksni_addr;
-				ni->ni_dev_cpt = ifaces[j].li_cpt;
-				memset(sa, 0, sizeof(*sa));
-				sa->sin_family = AF_INET;
-				sa->sin_addr.s_addr =
-					htonl(ifaces[j].li_ipaddr);
-				ksi->ksni_index =
-					ksocknal_ip2index((struct sockaddr *)sa,
-							  ni);
-				ksi->ksni_netmask = ifaces[j].li_netmask;
-				strlcpy(ksi->ksni_name, ifaces[j].li_name,
-					sizeof(ksi->ksni_name));
-				net->ksnn_ninterfaces++;
-				break;
-			}
-		}
-
-		/* ni_interfaces don't map to all network interfaces */
-		if (!ksi || net->ksnn_ninterfaces != i) {
-			CERROR("ksocklnd: requested %d but only %d interfaces found\n",
-			       i, net->ksnn_ninterfaces);
+		/* ni_interface doesn't contain the interface we want */
+		if (i == rc) {
+			CERROR("ksocklnd: failed to find interface %s\n",
+			       ni->ni_interface);
 			goto fail_1;
 		}
 	}
 
-	net_dev = dev_get_by_name(&init_net,
-				  net->ksnn_interfaces[0].ksni_name);
-	if (net_dev) {
-		node_id = dev_to_node(&net_dev->dev);
-		ni->ni_dev_cpt = cfs_cpt_of_node(lnet_cpt_table(), node_id);
-		dev_put(net_dev);
-	} else {
-		ni->ni_dev_cpt = CFS_CPT_ANY;
-	}
+	ni->ni_dev_cpt = ifaces[i].li_cpt;
+	sa = (void *)&ksi->ksni_addr;
+	memset(sa, 0, sizeof(*sa));
+	sa->sin_family = AF_INET;
+	sa->sin_addr.s_addr = htonl(ifaces[i].li_ipaddr);
+	ksi->ksni_index = ksocknal_ip2index((struct sockaddr *)sa, ni);
+	ksi->ksni_netmask = ifaces[i].li_netmask;
+	strlcpy(ksi->ksni_name, ifaces[i].li_name, sizeof(ksi->ksni_name));
 
 	/* call it before add it to ksocknal_data.ksnd_nets */
 	rc = ksocknal_net_start_threads(net, ni->ni_cpts, ni->ni_ncpts);
@@ -2856,7 +2276,6 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 	ni->ni_nid = LNET_MKNID(LNET_NIDNET(ni->ni_nid),
 				ntohl(((struct sockaddr_in *)&ksi->ksni_addr)->sin_addr.s_addr));
 	list_add(&net->ksnn_list, &ksocknal_data.ksnd_nets);
-
 	ksocknal_data.ksnd_nnets++;
 
 	return 0;
diff --git a/net/lnet/klnds/socklnd/socklnd.h b/net/lnet/klnds/socklnd/socklnd.h
index 83f0e3c..e6df3ed 100644
--- a/net/lnet/klnds/socklnd/socklnd.h
+++ b/net/lnet/klnds/socklnd/socklnd.h
@@ -169,8 +169,7 @@ struct ksock_net {
 	u64			ksnn_incarnation;	/* my epoch */
 	struct list_head	ksnn_list;		/* chain on global list */
 	atomic_t		ksnn_npeers;		/* # peers */
-	int			ksnn_ninterfaces;	/* IP interfaces */
-	struct ksock_interface	ksnn_interfaces[LNET_INTERFACES_NUM];
+	struct ksock_interface	ksnn_interface;		/* IP interface */
 };
 
 /* When the ksock_net is shut down, this bias is added to
diff --git a/net/lnet/lnet/api-ni.c b/net/lnet/lnet/api-ni.c
index 0c0b304..27640c7 100644
--- a/net/lnet/lnet/api-ni.c
+++ b/net/lnet/lnet/api-ni.c
@@ -68,10 +68,10 @@ struct lnet the_lnet = {
 module_param(rnet_htable_size, int, 0444);
 MODULE_PARM_DESC(rnet_htable_size, "size of remote network hash table");
 
-static int use_tcp_bonding = false;
+static int use_tcp_bonding;
 module_param(use_tcp_bonding, int, 0444);
 MODULE_PARM_DESC(use_tcp_bonding,
-		 "use_tcp_bonding parameter has been deprecated");
+		 "use_tcp_bonding parameter has been removed");
 
 unsigned int lnet_numa_range;
 EXPORT_SYMBOL(lnet_numa_range);
@@ -2480,19 +2480,6 @@ static void lnet_push_target_fini(void)
 	 * After than we want to delete the network being added,
 	 * to avoid a memory leak.
 	 */
-
-	/*
-	 * When a network uses TCP bonding then all its interfaces
-	 * must be specified when the network is first defined: the
-	 * TCP bonding code doesn't allow for interfaces to be added
-	 * or removed.
-	 */
-	if (net_l && net_l != net && use_tcp_bonding &&
-	    LNET_NETTYP(net_l->net_id) == SOCKLND) {
-		rc = -EINVAL;
-		goto failed0;
-	}
-
 	while ((ni = list_first_entry_or_null(&net->net_ni_added,
 					      struct lnet_ni,
 					      ni_netlist)) != NULL) {
@@ -2501,7 +2488,7 @@ static void lnet_push_target_fini(void)
 		/* make sure that the the NI we're about to start
 		 * up is actually unique. if it's not fail. */
 		if (!lnet_ni_unique_net(&net_l->net_ni_list,
-					ni->ni_interfaces[0])) {
+					ni->ni_interface)) {
 			rc = -EEXIST;
 			goto failed1;
 		}
@@ -2746,7 +2733,7 @@ void lnet_lib_exit(void)
 	}
 
 	if (use_tcp_bonding)
-		CWARN("'use_tcp_bonding' option has been deprecated. See LU-13641\n");
+		CWARN("use_tcp_bonding has been removed. Use Multi-Rail and Dynamic Discovery instead, see LU-13641\n");
 
 	/* If LNet is being initialized via DLC it is possible
 	 * that the user requests not to load module parameters (ones which
@@ -2756,8 +2743,7 @@ void lnet_lib_exit(void)
 	 * routes if it has been loaded
 	 */
 	if (!the_lnet.ln_nis_from_mod_params) {
-		rc = lnet_parse_networks(&net_head, lnet_get_networks(),
-					 use_tcp_bonding);
+		rc = lnet_parse_networks(&net_head, lnet_get_networks());
 		if (rc < 0)
 			goto err_empty_list;
 	}
@@ -2907,14 +2893,10 @@ void lnet_lib_exit(void)
 	if (!ni || !cfg_ni || !tun)
 		return;
 
-	if (ni->ni_interfaces[0]) {
-		for (i = 0; i < ARRAY_SIZE(ni->ni_interfaces); i++) {
-			if (ni->ni_interfaces[i]) {
-				strncpy(cfg_ni->lic_ni_intf[i],
-					ni->ni_interfaces[i],
-					sizeof(cfg_ni->lic_ni_intf[i]));
-			}
-		}
+	if (ni->ni_interface) {
+		strncpy(cfg_ni->lic_ni_intf,
+			ni->ni_interface,
+			sizeof(cfg_ni->lic_ni_intf));
 	}
 
 	cfg_ni->lic_nid = ni->ni_nid;
@@ -2922,7 +2904,6 @@ void lnet_lib_exit(void)
 		cfg_ni->lic_status = LNET_NI_STATUS_UP;
 	else
 		cfg_ni->lic_status = ni->ni_status->ns_status;
-	cfg_ni->lic_tcp_bonding = use_tcp_bonding;
 	cfg_ni->lic_dev_cpt = ni->ni_dev_cpt;
 
 	memcpy(&tun->lt_cmn, &ni->ni_net->net_tunables, sizeof(tun->lt_cmn));
@@ -2988,17 +2969,12 @@ void lnet_lib_exit(void)
 	if (!net_config)
 		return;
 
-	BUILD_BUG_ON(ARRAY_SIZE(ni->ni_interfaces) !=
-		     ARRAY_SIZE(net_config->ni_interfaces));
-
-	for (i = 0; i < ARRAY_SIZE(ni->ni_interfaces); i++) {
-		if (!ni->ni_interfaces[i])
-			break;
+	if (!ni->ni_interface)
+		return;
 
-		strncpy(net_config->ni_interfaces[i],
-			ni->ni_interfaces[i],
-			sizeof(net_config->ni_interfaces[i]));
-	}
+	strncpy(net_config->ni_interface,
+		ni->ni_interface,
+		sizeof(net_config->ni_interface));
 
 	config->cfg_nid = ni->ni_nid;
 	config->cfg_config_u.cfg_net.net_peer_timeout =
@@ -3339,7 +3315,7 @@ static int lnet_handle_legacy_ip2nets(char *ip2nets,
 	if (rc < 0)
 		return rc;
 
-	rc = lnet_parse_networks(&net_head, nets, use_tcp_bonding);
+	rc = lnet_parse_networks(&net_head, nets);
 	if (rc < 0)
 		return rc;
 
@@ -3404,7 +3380,7 @@ int lnet_dyn_add_ni(struct lnet_ioctl_config_ni *conf)
 	}
 
 	ni = lnet_ni_alloc_w_cpt_array(net, conf->lic_cpts, conf->lic_ncpts,
-				       conf->lic_ni_intf[0]);
+				       conf->lic_ni_intf);
 	if (!ni)
 		return -ENOMEM;
 
@@ -3523,7 +3499,7 @@ int lnet_dyn_del_ni(struct lnet_ioctl_config_ni *conf)
 	const char *nets = conf->cfg_config_u.cfg_net.net_intf;
 
 	/* Create a net/ni structures for the network string */
-	rc = lnet_parse_networks(&net_head, nets, use_tcp_bonding);
+	rc = lnet_parse_networks(&net_head, nets);
 	if (rc <= 0)
 		return rc == 0 ? -EINVAL : rc;
 
diff --git a/net/lnet/lnet/config.c b/net/lnet/lnet/config.c
index 10a7fe9..ee68c63 100644
--- a/net/lnet/lnet/config.c
+++ b/net/lnet/lnet/config.c
@@ -112,24 +112,8 @@ struct lnet_text_buf {		/* tmp struct for parsing routes */
 	list_for_each(tmp, nilist) {
 		ni = list_entry(tmp, struct lnet_ni, ni_netlist);
 
-		if (ni->ni_interfaces[0] &&
-		    strncmp(ni->ni_interfaces[0], iface, strlen(iface)) == 0)
-			return false;
-	}
-
-	return true;
-}
-
-/* check that the NI is unique to the interfaces with in the same NI.
- * This is only a consideration if use_tcp_bonding is set */
-static bool
-lnet_ni_unique_ni(char *iface_list[LNET_INTERFACES_NUM], char *iface)
-{
-	int i;
-
-	for (i = 0; i < LNET_INTERFACES_NUM; i++) {
-		if (iface_list[i] &&
-		    strncmp(iface_list[i], iface, strlen(iface)) == 0)
+		if (ni->ni_interface &&
+		    strncmp(ni->ni_interface, iface, strlen(iface)) == 0)
 			return false;
 	}
 
@@ -293,8 +277,6 @@ struct lnet_text_buf {		/* tmp struct for parsing routes */
 void
 lnet_ni_free(struct lnet_ni *ni)
 {
-	int i;
-
 	lnet_net_remove_cpts(ni->ni_cpts, ni->ni_ncpts, ni->ni_net);
 
 	if (ni->ni_refs)
@@ -305,8 +287,7 @@ struct lnet_text_buf {		/* tmp struct for parsing routes */
 
 	kfree(ni->ni_cpts);
 
-	for (i = 0; i < LNET_INTERFACES_NUM && ni->ni_interfaces[i]; i++)
-		kfree(ni->ni_interfaces[i]);
+	kfree(ni->ni_interface);
 
 	/* release reference to net namespace */
 	if (ni->ni_net_ns)
@@ -394,29 +375,25 @@ struct lnet_net *
 	if (!ni)
 		return -ENOMEM;
 
-	if (!lnet_ni_unique_ni(ni->ni_interfaces, iface))
-		return -EINVAL;
-
 	/* Allocate a separate piece of memory and copy
 	 * into it the string, so we don't have
 	 * a depencency on the tokens string.  This way we
 	 * can free the tokens at the end of the function.
-	 * The newly allocated ni_interfaces[] can be
+	 * The newly allocated ni_interface[] can be
 	 * freed when freeing the NI */
-	while (niface < LNET_INTERFACES_NUM &&
-	       ni->ni_interfaces[niface])
+	if (ni->ni_interface)
 		niface++;
 
-	if (niface >= LNET_INTERFACES_NUM) {
+	if (niface >= 1) {
 		LCONSOLE_ERROR_MSG(0x115, "Too many interfaces "
 				   "for net %s\n",
 				   libcfs_net2str(LNET_NIDNET(ni->ni_nid)));
 		return -EINVAL;
 	}
 
-	ni->ni_interfaces[niface] = kstrdup(iface, GFP_KERNEL);
+	ni->ni_interface = kstrdup(iface, GFP_KERNEL);
 
-	if (!ni->ni_interfaces[niface]) {
+	if (!ni->ni_interface) {
 		CERROR("Can't allocate net interface name\n");
 		return -ENOMEM;
 	}
@@ -572,8 +549,7 @@ struct lnet_ni *
  * nilist.
  */
 int
-lnet_parse_networks(struct list_head *netlist, const char *networks,
-		    bool use_tcp_bonding)
+lnet_parse_networks(struct list_head *netlist, const char *networks)
 {
 	struct cfs_expr_list *net_el = NULL;
 	struct cfs_expr_list *ni_el = NULL;
@@ -712,8 +688,7 @@ struct lnet_ni *
 		if (IS_ERR_OR_NULL(net))
 			goto failed;
 
-		if (!nistr ||
-		    (use_tcp_bonding && LNET_NETTYP(net_id) == SOCKLND)) {
+		if (!nistr) {
 			/*
 			 * No interface list was specified, allocate a
 			 * ni using the defaults.
@@ -792,16 +767,9 @@ struct lnet_ni *
 				goto failed_syntax;
 			}
 
-			if (use_tcp_bonding &&
-			    LNET_NETTYP(net->net_id) == SOCKLND) {
-				rc = lnet_ni_add_interface(ni, name);
-				if (rc != 0)
-					goto failed;
-			} else {
-				ni = lnet_ni_alloc(net, ni_el, name);
-				if (IS_ERR_OR_NULL(ni))
-					goto failed;
-			}
+			ni = lnet_ni_alloc(net, ni_el, name);
+			if (IS_ERR_OR_NULL(ni))
+				goto failed;
 
 			if (ni_el) {
 				if (ni_el != net_el) {
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 06/29] lnet: socklnd: replace route construct
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (4 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 05/29] lnet: socklnd: remove tcp bonding James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 07/29] lustre: readahead: limit over reservation James Simmons
                   ` (22 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown
  Cc: Serguei Smirnov, Lustre Development List

From: Serguei Smirnov <ssmirnov@whamcloud.com>

With TCP bonding removed, it's no longer necessary to
maintain multiple route constructs per peer_ni in socklnd.
Replace the route construct with connection control block,
conn_cb, and make sure there's a single conn_cb per peer_ni.

WC-bug-id: https://jira.whamcloud.com/browse/LU-13641
Lustre-commit: 7766f01e891c378d ("LU-13641 socklnd: replace route construct")
Signed-off-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/40774
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/klnds/socklnd/socklnd.c    | 367 +++++++++++++++---------------------
 net/lnet/klnds/socklnd/socklnd.h    |  38 ++--
 net/lnet/klnds/socklnd/socklnd_cb.c | 200 ++++++++++----------
 3 files changed, 273 insertions(+), 332 deletions(-)

diff --git a/net/lnet/klnds/socklnd/socklnd.c b/net/lnet/klnds/socklnd/socklnd.c
index 55d1ba5..141da88 100644
--- a/net/lnet/klnds/socklnd/socklnd.c
+++ b/net/lnet/klnds/socklnd/socklnd.c
@@ -112,40 +112,40 @@ static int ksocknal_ip2index(struct sockaddr *addr, struct lnet_ni *ni)
 	return ret;
 }
 
-static struct ksock_route *
-ksocknal_create_route(struct sockaddr *addr)
+static struct ksock_conn_cb *
+ksocknal_create_conn_cb(struct sockaddr *addr)
 {
-	struct ksock_route *route;
+	struct ksock_conn_cb *conn_cb;
 
-	route = kzalloc(sizeof(*route), GFP_NOFS);
-	if (!route)
+	conn_cb = kzalloc(sizeof(*conn_cb), GFP_NOFS);
+	if (!conn_cb)
 		return NULL;
 
-	refcount_set(&route->ksnr_refcount, 1);
-	route->ksnr_peer = NULL;
-	route->ksnr_retry_interval = 0;		/* OK to connect at any time */
-	rpc_copy_addr((struct sockaddr *)&route->ksnr_addr, addr);
-	rpc_set_port((struct sockaddr *)&route->ksnr_addr, rpc_get_port(addr));
-	route->ksnr_myiface = -1;
-	route->ksnr_scheduled = 0;
-	route->ksnr_connecting = 0;
-	route->ksnr_connected = 0;
-	route->ksnr_deleted = 0;
-	route->ksnr_conn_count = 0;
-	route->ksnr_share_count = 0;
-
-	return route;
+	refcount_set(&conn_cb->ksnr_refcount, 1);
+	conn_cb->ksnr_peer = NULL;
+	conn_cb->ksnr_retry_interval = 0;	/* OK to connect at any time */
+	rpc_copy_addr((struct sockaddr *)&conn_cb->ksnr_addr, addr);
+	rpc_set_port((struct sockaddr *)&conn_cb->ksnr_addr,
+		     rpc_get_port(addr));
+	conn_cb->ksnr_myiface = -1;
+	conn_cb->ksnr_scheduled = 0;
+	conn_cb->ksnr_connecting = 0;
+	conn_cb->ksnr_connected = 0;
+	conn_cb->ksnr_deleted = 0;
+	conn_cb->ksnr_conn_count = 0;
+
+	return conn_cb;
 }
 
 void
-ksocknal_destroy_route(struct ksock_route *route)
+ksocknal_destroy_conn_cb(struct ksock_conn_cb *conn_cb)
 {
-	LASSERT(!refcount_read(&route->ksnr_refcount));
+	LASSERT(refcount_read(&conn_cb->ksnr_refcount) == 0);
 
-	if (route->ksnr_peer)
-		ksocknal_peer_decref(route->ksnr_peer);
+	if (conn_cb->ksnr_peer)
+		ksocknal_peer_decref(conn_cb->ksnr_peer);
 
-	kfree(route);
+	kfree(conn_cb);
 }
 
 static struct ksock_peer_ni *
@@ -178,9 +178,9 @@ static int ksocknal_ip2index(struct sockaddr *addr, struct lnet_ni *ni)
 	peer_ni->ksnp_proto = NULL;
 	peer_ni->ksnp_last_alive = 0;
 	peer_ni->ksnp_zc_next_cookie = SOCKNAL_KEEPALIVE_PING + 1;
+	peer_ni->ksnp_conn_cb = NULL;
 
 	INIT_LIST_HEAD(&peer_ni->ksnp_conns);
-	INIT_LIST_HEAD(&peer_ni->ksnp_routes);
 	INIT_LIST_HEAD(&peer_ni->ksnp_tx_queue);
 	INIT_LIST_HEAD(&peer_ni->ksnp_zc_req_list);
 	spin_lock_init(&peer_ni->ksnp_lock);
@@ -199,17 +199,16 @@ static int ksocknal_ip2index(struct sockaddr *addr, struct lnet_ni *ni)
 	LASSERT(!refcount_read(&peer_ni->ksnp_refcount));
 	LASSERT(!peer_ni->ksnp_accepting);
 	LASSERT(list_empty(&peer_ni->ksnp_conns));
-	LASSERT(list_empty(&peer_ni->ksnp_routes));
+	LASSERT(!peer_ni->ksnp_conn_cb);
 	LASSERT(list_empty(&peer_ni->ksnp_tx_queue));
 	LASSERT(list_empty(&peer_ni->ksnp_zc_req_list));
 
 	kfree(peer_ni);
 
-	/*
-	 * NB a peer_ni's connections and routes keep a reference on their peer
-	 * until they are destroyed, so we can be assured that _all_ state to
-	 * do with this peer_ni has been cleaned up when its refcount drops to
-	 * zero.
+	/* NB a peer_ni's connections and conn_cb keep a reference on their
+	 * peer until they are destroyed, so we can be assured that _all_
+	 * state to do with this peer_ni has been cleaned up when its refcount
+	 * drops to zero.
 	 */
 	if (atomic_dec_and_test(&net->ksnn_npeers))
 		wake_up_var(&net->ksnn_npeers);
@@ -279,7 +278,7 @@ struct ksock_peer_ni *
 	}
 
 	LASSERT(list_empty(&peer_ni->ksnp_conns));
-	LASSERT(list_empty(&peer_ni->ksnp_routes));
+	LASSERT(!peer_ni->ksnp_conn_cb);
 	LASSERT(!peer_ni->ksnp_closing);
 	peer_ni->ksnp_closing = 1;
 	hlist_del(&peer_ni->ksnp_list);
@@ -293,7 +292,7 @@ struct ksock_peer_ni *
 		       int *port, int *conn_count, int *share_count)
 {
 	struct ksock_peer_ni *peer_ni;
-	struct ksock_route *route;
+	struct ksock_conn_cb *conn_cb;
 	int i;
 	int j;
 	int rc = -ENOENT;
@@ -305,7 +304,7 @@ struct ksock_peer_ni *
 			continue;
 
 		if (!peer_ni->ksnp_n_passive_ips &&
-		    list_empty(&peer_ni->ksnp_routes)) {
+		    !peer_ni->ksnp_conn_cb) {
 			if (index-- > 0)
 				continue;
 
@@ -333,18 +332,19 @@ struct ksock_peer_ni *
 			goto out;
 		}
 
-		list_for_each_entry(route, &peer_ni->ksnp_routes,
-				    ksnr_list) {
+		if (peer_ni->ksnp_conn_cb) {
 			if (index-- > 0)
 				continue;
 
+			conn_cb = peer_ni->ksnp_conn_cb;
+
 			*id = peer_ni->ksnp_id;
-			if (route->ksnr_addr.ss_family == AF_INET) {
+			if (conn_cb->ksnr_addr.ss_family == AF_INET) {
 				struct sockaddr_in *sa;
 
-				sa = (void *)&route->ksnr_addr;
+				sa = (void *)&conn_cb->ksnr_addr;
 				rc = choose_ipv4_src(myip,
-						     route->ksnr_myiface,
+						     conn_cb->ksnr_myiface,
 						     ntohl(sa->sin_addr.s_addr),
 						     ni->ni_net_ns);
 				*peer_ip = ntohl(sa->sin_addr.s_addr);
@@ -355,8 +355,8 @@ struct ksock_peer_ni *
 				*port = 0;
 				rc = -ENOTSUPP;
 			}
-			*conn_count = route->ksnr_conn_count;
-			*share_count = route->ksnr_share_count;
+			*conn_count = conn_cb->ksnr_conn_count;
+			*share_count = 1;
 			goto out;
 		}
 	}
@@ -366,133 +366,121 @@ struct ksock_peer_ni *
 }
 
 static void
-ksocknal_associate_route_conn_locked(struct ksock_route *route,
-				     struct ksock_conn *conn)
+ksocknal_associate_cb_conn_locked(struct ksock_conn_cb *conn_cb,
+				  struct ksock_conn *conn)
 {
-	struct ksock_peer_ni *peer_ni = route->ksnr_peer;
+	struct ksock_peer_ni *peer_ni = conn_cb->ksnr_peer;
 	int type = conn->ksnc_type;
 	struct ksock_interface *iface;
 	int conn_iface;
 
 	conn_iface = ksocknal_ip2index((struct sockaddr *)&conn->ksnc_myaddr,
-				       route->ksnr_peer->ksnp_ni);
-	conn->ksnc_route = route;
-	ksocknal_route_addref(route);
-
-	if (route->ksnr_myiface != conn_iface) {
-		if (route->ksnr_myiface < 0) {
-			/* route wasn't bound locally yet (the initial route) */
+				       peer_ni->ksnp_ni);
+	conn->ksnc_conn_cb = conn_cb;
+	ksocknal_conn_cb_addref(conn_cb);
+
+	if (conn_cb->ksnr_myiface != conn_iface) {
+		if (conn_cb->ksnr_myiface < 0) {
+			/* conn_cb wasn't bound locally yet (the initial
+			 * conn_cb)
+			 */
 			CDEBUG(D_NET, "Binding %s %pIS to interface %d\n",
 			       libcfs_id2str(peer_ni->ksnp_id),
-			       &route->ksnr_addr,
+			       &conn_cb->ksnr_addr,
 			       conn_iface);
 		} else {
 			CDEBUG(D_NET,
 			       "Rebinding %s %pIS from interface %d to %d\n",
 			       libcfs_id2str(peer_ni->ksnp_id),
-			       &route->ksnr_addr,
-			       route->ksnr_myiface,
+			       &conn_cb->ksnr_addr,
+			       conn_cb->ksnr_myiface,
 			       conn_iface);
 
-			iface = ksocknal_index2iface(route->ksnr_peer->ksnp_ni,
-						     route->ksnr_myiface);
+			iface = ksocknal_index2iface(peer_ni->ksnp_ni,
+						     conn_cb->ksnr_myiface);
 			if (iface)
 				iface->ksni_nroutes--;
 		}
-		route->ksnr_myiface = conn_iface;
-		iface = ksocknal_index2iface(route->ksnr_peer->ksnp_ni,
-					     route->ksnr_myiface);
+		conn_cb->ksnr_myiface = conn_iface;
+		iface = ksocknal_index2iface(peer_ni->ksnp_ni,
+					     conn_cb->ksnr_myiface);
 		if (iface)
 			iface->ksni_nroutes++;
 	}
 
-	route->ksnr_connected |= (1 << type);
-	route->ksnr_conn_count++;
+	conn_cb->ksnr_connected |= (1 << type);
+	conn_cb->ksnr_conn_count++;
 
-	/*
-	 * Successful connection => further attempts can
+	/* Successful connection => further attempts can
 	 * proceed immediately
 	 */
-	route->ksnr_retry_interval = 0;
+	conn_cb->ksnr_retry_interval = 0;
 }
 
 static void
-ksocknal_add_route_locked(struct ksock_peer_ni *peer_ni, struct ksock_route *route)
+ksocknal_add_conn_cb_locked(struct ksock_peer_ni *peer_ni,
+			    struct ksock_conn_cb *conn_cb)
 {
 	struct ksock_conn *conn;
-	struct ksock_route *route2;
 	struct ksock_net *net = peer_ni->ksnp_ni->ni_data;
 
 	LASSERT(!peer_ni->ksnp_closing);
-	LASSERT(!route->ksnr_peer);
-	LASSERT(!route->ksnr_scheduled);
-	LASSERT(!route->ksnr_connecting);
-	LASSERT(!route->ksnr_connected);
-
-	/* LASSERT(unique) */
-	list_for_each_entry(route2, &peer_ni->ksnp_routes, ksnr_list) {
-		if (rpc_cmp_addr((struct sockaddr *)&route2->ksnr_addr,
-				 (struct sockaddr *)&route->ksnr_addr)) {
-			CERROR("Duplicate route %s %pIS\n",
-			       libcfs_id2str(peer_ni->ksnp_id),
-			       &route->ksnr_addr);
-			LBUG();
-		}
-	}
+	LASSERT(!conn_cb->ksnr_peer);
+	LASSERT(!conn_cb->ksnr_scheduled);
+	LASSERT(!conn_cb->ksnr_connecting);
+	LASSERT(!conn_cb->ksnr_connected);
 
-	route->ksnr_peer = peer_ni;
+	conn_cb->ksnr_peer = peer_ni;
 	ksocknal_peer_addref(peer_ni);
 
-	/* set the route's interface to the current net's interface */
-	route->ksnr_myiface = net->ksnn_interface.ksni_index;
+	/* set the conn_cb's interface to the current net's interface */
+	conn_cb->ksnr_myiface = net->ksnn_interface.ksni_index;
 	net->ksnn_interface.ksni_nroutes++;
 
-	/* peer_ni's routelist takes over my ref on 'route' */
-	list_add_tail(&route->ksnr_list, &peer_ni->ksnp_routes);
+	/* peer_ni's route list takes over my ref on 'route' */
+	peer_ni->ksnp_conn_cb = conn_cb;
 
 	list_for_each_entry(conn, &peer_ni->ksnp_conns, ksnc_list) {
 		if (!rpc_cmp_addr((struct sockaddr *)&conn->ksnc_peeraddr,
-				  (struct sockaddr *)&route->ksnr_addr))
+				  (struct sockaddr *)&conn_cb->ksnr_addr))
 			continue;
 
-		ksocknal_associate_route_conn_locked(route, conn);
-		/* keep going (typed routes) */
+		ksocknal_associate_cb_conn_locked(conn_cb, conn);
+		/* keep going (typed conns) */
 	}
 }
 
 static void
-ksocknal_del_route_locked(struct ksock_route *route)
+ksocknal_del_conn_cb_locked(struct ksock_conn_cb *conn_cb)
 {
-	struct ksock_peer_ni *peer_ni = route->ksnr_peer;
+	struct ksock_peer_ni *peer_ni = conn_cb->ksnr_peer;
 	struct ksock_interface *iface;
 	struct ksock_conn *conn;
 	struct ksock_conn *cnxt;
 
-	LASSERT(!route->ksnr_deleted);
+	LASSERT(!conn_cb->ksnr_deleted);
 
 	/* Close associated conns */
 	list_for_each_entry_safe(conn, cnxt, &peer_ni->ksnp_conns, ksnc_list) {
-		if (conn->ksnc_route != route)
+		if (conn->ksnc_conn_cb != conn_cb)
 			continue;
 
 		ksocknal_close_conn_locked(conn, 0);
 	}
 
-	if (route->ksnr_myiface >= 0) {
-		iface = ksocknal_index2iface(route->ksnr_peer->ksnp_ni,
-					     route->ksnr_myiface);
+	if (conn_cb->ksnr_myiface >= 0) {
+		iface = ksocknal_index2iface(peer_ni->ksnp_ni,
+					     conn_cb->ksnr_myiface);
 		if (iface)
 			iface->ksni_nroutes--;
 	}
 
-	route->ksnr_deleted = 1;
-	list_del(&route->ksnr_list);
-	ksocknal_route_decref(route);		/* drop peer_ni's ref */
+	conn_cb->ksnr_deleted = 1;
+	ksocknal_conn_cb_decref(conn_cb);	/* drop peer_ni's ref */
+	peer_ni->ksnp_conn_cb = NULL;
 
-	if (list_empty(&peer_ni->ksnp_routes) &&
-	    list_empty(&peer_ni->ksnp_conns)) {
-		/*
-		 * I've just removed the last route to a peer_ni with no active
+	if (list_empty(&peer_ni->ksnp_conns)) {
+		/* I've just removed the last route to a peer_ni with no active
 		 * connections
 		 */
 		ksocknal_unlink_peer_locked(peer_ni);
@@ -505,8 +493,7 @@ struct ksock_peer_ni *
 {
 	struct ksock_peer_ni *peer_ni;
 	struct ksock_peer_ni *peer2;
-	struct ksock_route *route;
-	struct ksock_route *route2;
+	struct ksock_conn_cb *conn_cb;
 	struct sockaddr_in sa = {.sin_family = AF_INET};
 
 	if (id.nid == LNET_NID_ANY ||
@@ -520,8 +507,8 @@ struct ksock_peer_ni *
 
 	sa.sin_addr.s_addr = htonl(ipaddr);
 	sa.sin_port = htons(port);
-	route = ksocknal_create_route((struct sockaddr *)&sa);
-	if (!route) {
+	conn_cb = ksocknal_create_conn_cb((struct sockaddr *)&sa);
+	if (!conn_cb) {
 		ksocknal_peer_decref(peer_ni);
 		return -ENOMEM;
 	}
@@ -540,20 +527,8 @@ struct ksock_peer_ni *
 		hash_add(ksocknal_data.ksnd_peers, &peer_ni->ksnp_list, id.nid);
 	}
 
-	list_for_each_entry(route2, &peer_ni->ksnp_routes, ksnr_list) {
-		struct sockaddr_in *sa = (void *)&route->ksnr_addr;
+	ksocknal_add_conn_cb_locked(peer_ni, conn_cb);
 
-		if (ipaddr != ntohl(sa->sin_addr.s_addr)) {
-			/* Route already exists, use the old one */
-			ksocknal_route_decref(route);
-			route2->ksnr_share_count++;
-			goto out;
-		}
-	}
-	/* Route doesn't already exist, add the new one */
-	ksocknal_add_route_locked(peer_ni, route);
-	route->ksnr_share_count++;
-out:
 	write_unlock_bh(&ksocknal_data.ksnd_global_lock);
 
 	return 0;
@@ -564,50 +539,22 @@ struct ksock_peer_ni *
 {
 	struct ksock_conn *conn;
 	struct ksock_conn *cnxt;
-	struct ksock_route *route;
-	struct ksock_route *rnxt;
-	int nshared;
+	struct ksock_conn_cb *conn_cb;
 
 	LASSERT(!peer_ni->ksnp_closing);
 
 	/* Extra ref prevents peer_ni disappearing until I'm done with it */
 	ksocknal_peer_addref(peer_ni);
+	conn_cb = peer_ni->ksnp_conn_cb;
+	if (conn_cb)
+		ksocknal_del_conn_cb_locked(conn_cb);
 
-	list_for_each_entry_safe(route, rnxt, &peer_ni->ksnp_routes,
-				 ksnr_list) {
-		struct sockaddr_in *sa = (void *)&route->ksnr_addr;
-
-		/* no match */
-		if (!(!ip || ntohl(sa->sin_addr.s_addr) == ip))
-			continue;
-
-		route->ksnr_share_count = 0;
-		/* This deletes associated conns too */
-		ksocknal_del_route_locked(route);
-	}
-
-	nshared = 0;
-	list_for_each_entry(route, &peer_ni->ksnp_routes, ksnr_list)
-		nshared += route->ksnr_share_count;
-
-	if (!nshared) {
-		/* remove everything else if there are no explicit entries
-		 * left
-		 */
-		list_for_each_entry_safe(route, rnxt, &peer_ni->ksnp_routes,
-					 ksnr_list) {
-			/* we should only be removing auto-entries */
-			LASSERT(!route->ksnr_share_count);
-			ksocknal_del_route_locked(route);
-		}
-
-		list_for_each_entry_safe(conn, cnxt, &peer_ni->ksnp_conns,
-					 ksnc_list)
-			ksocknal_close_conn_locked(conn, 0);
-	}
+	list_for_each_entry_safe(conn, cnxt, &peer_ni->ksnp_conns,
+				 ksnc_list)
+		ksocknal_close_conn_locked(conn, 0);
 
 	ksocknal_peer_decref(peer_ni);
-	/* NB peer_ni unlinks itself when last conn/route is removed */
+	/* NB peer_ni unlinks itself when last conn/conn_cb is removed */
 }
 
 static int
@@ -651,7 +598,7 @@ struct ksock_peer_ni *
 			if (peer_ni->ksnp_closing &&
 			    !list_empty(&peer_ni->ksnp_tx_queue)) {
 				LASSERT(list_empty(&peer_ni->ksnp_conns));
-				LASSERT(list_empty(&peer_ni->ksnp_routes));
+				LASSERT(!peer_ni->ksnp_conn_cb);
 
 				list_splice_init(&peer_ni->ksnp_tx_queue,
 						 &zombies);
@@ -753,19 +700,16 @@ struct ksock_peer_ni *
 }
 
 static int
-ksocknal_connecting(struct ksock_peer_ni *peer_ni, struct sockaddr *sa)
+ksocknal_connecting(struct ksock_conn_cb *conn_cb, struct sockaddr *sa)
 {
-	struct ksock_route *route;
-
-	list_for_each_entry(route, &peer_ni->ksnp_routes, ksnr_list) {
-		if (rpc_cmp_addr((struct sockaddr *)&route->ksnr_addr, sa))
-			return route->ksnr_connecting;
-	}
+	if (conn_cb &&
+	    rpc_cmp_addr((struct sockaddr *)&conn_cb->ksnr_addr, sa))
+		return conn_cb->ksnr_connecting;
 	return 0;
 }
 
 int
-ksocknal_create_conn(struct lnet_ni *ni, struct ksock_route *route,
+ksocknal_create_conn(struct lnet_ni *ni, struct ksock_conn_cb *conn_cb,
 		     struct socket *sock, int type)
 {
 	rwlock_t *global_lock = &ksocknal_data.ksnd_global_lock;
@@ -787,7 +731,7 @@ struct ksock_peer_ni *
 	int active;
 	char *warn = NULL;
 
-	active = !!route;
+	active = !!conn_cb;
 
 	LASSERT(active == (type != SOCKLND_CONN_NONE));
 
@@ -798,7 +742,7 @@ struct ksock_peer_ni *
 	}
 
 	conn->ksnc_peer = NULL;
-	conn->ksnc_route = NULL;
+	conn->ksnc_conn_cb = NULL;
 	conn->ksnc_sock = sock;
 	/*
 	 * 2 ref, 1 for conn, another extra ref prevents socket
@@ -838,7 +782,7 @@ struct ksock_peer_ni *
 	 * eagerly
 	 */
 	if (active) {
-		peer_ni = route->ksnr_peer;
+		peer_ni = conn_cb->ksnr_peer;
 		LASSERT(ni == peer_ni->ksnp_ni);
 
 		/* Active connection sends HELLO eagerly */
@@ -917,8 +861,8 @@ struct ksock_peer_ni *
 		 * favour of higher NID...
 		 */
 		if (peerid.nid < ni->ni_nid &&
-		    ksocknal_connecting(peer_ni, ((struct sockaddr *)
-						 &conn->ksnc_peeraddr))) {
+		    ksocknal_connecting(peer_ni->ksnp_conn_cb,
+					((struct sockaddr *)&conn->ksnc_peeraddr))) {
 			rc = EALREADY;
 			warn = "connection race resolution";
 			goto failed_2;
@@ -926,10 +870,10 @@ struct ksock_peer_ni *
 	}
 
 	if (peer_ni->ksnp_closing ||
-	    (active && route->ksnr_deleted)) {
-		/* peer_ni/route got closed under me */
+	    (active && conn_cb->ksnr_deleted)) {
+		/* peer_ni/conn_cb got closed under me */
 		rc = -ESTALE;
-		warn = "peer_ni/route removed";
+		warn = "peer_ni/conn_cb removed";
 		goto failed_2;
 	}
 
@@ -998,34 +942,29 @@ struct ksock_peer_ni *
 		}
 	}
 
-	/*
-	 * If the connection created by this route didn't bind to the IP
-	 * address the route connected to, the connection/route matching
+	/* If the connection created by this conn_cb didn't bind to the IP
+	 * address the conn_cb connected to, the connection/conn_cb matching
 	 * code below probably isn't going to work.
 	 */
 	if (active &&
-	    !rpc_cmp_addr((struct sockaddr *)&route->ksnr_addr,
+	    !rpc_cmp_addr((struct sockaddr *)&conn_cb->ksnr_addr,
 			  (struct sockaddr *)&conn->ksnc_peeraddr)) {
 		CERROR("Route %s %pIS connected to %pIS\n",
 		       libcfs_id2str(peer_ni->ksnp_id),
-		       &route->ksnr_addr,
+		       &conn_cb->ksnr_addr,
 		       &conn->ksnc_peeraddr);
 	}
 
-	/*
-	 * Search for a route corresponding to the new connection and
+	/* Search for a conn_cb corresponding to the new connection and
 	 * create an association. This allows incoming connections created
-	 * by routes in my peer_ni to match my own route entries so I don't
-	 * continually create duplicate routes.
+	 * by conn_cb in my peer_ni to match my own conn_cb entries so I don't
+	 * continually create duplicate conn_cbs.
 	 */
-	list_for_each_entry(route, &peer_ni->ksnp_routes, ksnr_list) {
-		if (!rpc_cmp_addr((struct sockaddr *)&route->ksnr_addr,
-				  (struct sockaddr *)&conn->ksnc_peeraddr))
-			continue;
+	conn_cb = peer_ni->ksnp_conn_cb;
 
-		ksocknal_associate_route_conn_locked(route, conn);
-		break;
-	}
+	if (conn_cb && rpc_cmp_addr((struct sockaddr *)&conn->ksnc_peeraddr,
+				    (struct sockaddr *)&conn_cb->ksnr_addr))
+		ksocknal_associate_cb_conn_locked(conn_cb, conn);
 
 	conn->ksnc_peer = peer_ni;	/* conn takes my ref on peer_ni */
 	peer_ni->ksnp_last_alive = ktime_get_seconds();
@@ -1135,7 +1074,7 @@ struct ksock_peer_ni *
 failed_2:
 	if (!peer_ni->ksnp_closing &&
 	    list_empty(&peer_ni->ksnp_conns) &&
-	    list_empty(&peer_ni->ksnp_routes)) {
+	    !peer_ni->ksnp_conn_cb) {
 		list_splice_init(&peer_ni->ksnp_tx_queue, &zombies);
 		ksocknal_unlink_peer_locked(peer_ni);
 	}
@@ -1183,6 +1122,7 @@ struct ksock_peer_ni *
 
 failed_0:
 	sock_release(sock);
+
 	return rc;
 }
 
@@ -1195,7 +1135,7 @@ struct ksock_peer_ni *
 	 * Caller holds ksnd_global_lock exclusively in irq context
 	 */
 	struct ksock_peer_ni *peer_ni = conn->ksnc_peer;
-	struct ksock_route *route;
+	struct ksock_conn_cb *conn_cb;
 	struct ksock_conn *conn2;
 
 	LASSERT(!peer_ni->ksnp_error);
@@ -1205,22 +1145,23 @@ struct ksock_peer_ni *
 	/* ksnd_deathrow_conns takes over peer_ni's ref */
 	list_del(&conn->ksnc_list);
 
-	route = conn->ksnc_route;
-	if (route) {
-		/* dissociate conn from route... */
-		LASSERT(!route->ksnr_deleted);
-		LASSERT(route->ksnr_connected & (1 << conn->ksnc_type));
+	conn_cb = conn->ksnc_conn_cb;
+	if (conn_cb) {
+		/* dissociate conn from cb... */
+		LASSERT(!conn_cb->ksnr_deleted);
+		LASSERT(conn_cb->ksnr_connected & BIT(conn->ksnc_type));
 
 		list_for_each_entry(conn2, &peer_ni->ksnp_conns, ksnc_list) {
-			if (conn2->ksnc_route == route &&
+			if (conn2->ksnc_conn_cb == conn_cb &&
 			    conn2->ksnc_type == conn->ksnc_type)
 				goto conn2_found;
 		}
-		route->ksnr_connected &= ~(1 << conn->ksnc_type);
+		conn_cb->ksnr_connected &= ~BIT(conn->ksnc_type);
 conn2_found:
-		conn->ksnc_route = NULL;
+		conn->ksnc_conn_cb = NULL;
 
-		ksocknal_route_decref(route);     /* drop conn's ref on route */
+		/* drop conn's ref on route */
+		ksocknal_conn_cb_decref(conn_cb);
 	}
 
 	if (list_empty(&peer_ni->ksnp_conns)) {
@@ -1248,10 +1189,9 @@ struct ksock_peer_ni *
 		peer_ni->ksnp_proto = NULL;  /* renegotiate protocol version */
 		peer_ni->ksnp_error = error; /* stash last conn close reason */
 
-		if (list_empty(&peer_ni->ksnp_routes)) {
-			/*
-			 * I've just closed last conn belonging to a
-			 * peer_ni with no routes to it
+		if (!peer_ni->ksnp_conn_cb) {
+			/* I've just closed last conn belonging to a
+			 * peer_ni with no connections to it
 			 */
 			ksocknal_unlink_peer_locked(peer_ni);
 		}
@@ -1282,7 +1222,7 @@ struct ksock_peer_ni *
 	if (!(peer_ni->ksnp_id.pid & LNET_PID_USERFLAG) &&
 	    list_empty(&peer_ni->ksnp_conns) &&
 	    !peer_ni->ksnp_accepting &&
-	    !ksocknal_find_connecting_route_locked(peer_ni)) {
+	    !ksocknal_find_connecting_conn_cb_locked(peer_ni)) {
 		notify = true;
 		last_alive = peer_ni->ksnp_last_alive;
 	}
@@ -1422,7 +1362,7 @@ struct ksock_peer_ni *
 	LASSERT(!refcount_read(&conn->ksnc_conn_refcount));
 	LASSERT(!refcount_read(&conn->ksnc_sock_refcount));
 	LASSERT(!conn->ksnc_sock);
-	LASSERT(!conn->ksnc_route);
+	LASSERT(!conn->ksnc_conn_cb);
 	LASSERT(!conn->ksnc_tx_scheduled);
 	LASSERT(!conn->ksnc_rx_scheduled);
 	LASSERT(list_empty(&conn->ksnc_tx_queue));
@@ -2012,7 +1952,7 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 	read_lock(&ksocknal_data.ksnd_global_lock);
 
 	hash_for_each(ksocknal_data.ksnd_peers, i, peer_ni, ksnp_list) {
-		struct ksock_route *route;
+		struct ksock_conn_cb *conn_cb;
 		struct ksock_conn *conn;
 
 		if (peer_ni->ksnp_ni != ni)
@@ -2027,13 +1967,12 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 		      !list_empty(&peer_ni->ksnp_tx_queue),
 		      !list_empty(&peer_ni->ksnp_zc_req_list));
 
-		list_for_each_entry(route, &peer_ni->ksnp_routes, ksnr_list) {
-			CWARN("Route: ref %d, schd %d, conn %d, cnted %d, del %d\n",
-			      refcount_read(&route->ksnr_refcount),
-			      route->ksnr_scheduled,
-			      route->ksnr_connecting,
-			      route->ksnr_connected,
-			      route->ksnr_deleted);
+		conn_cb = peer_ni->ksnp_conn_cb;
+		if (conn_cb) {
+			CWARN("ConnCB: ref %d, schd %d, conn %d, cnted %d, del %d\n",
+			      refcount_read(&conn_cb->ksnr_refcount),
+			      conn_cb->ksnr_scheduled, conn_cb->ksnr_connecting,
+			      conn_cb->ksnr_connected, conn_cb->ksnr_deleted);
 		}
 
 		list_for_each_entry(conn, &peer_ni->ksnp_conns, ksnc_list) {
diff --git a/net/lnet/klnds/socklnd/socklnd.h b/net/lnet/klnds/socklnd/socklnd.h
index e6df3ed..9f8fe8a 100644
--- a/net/lnet/klnds/socklnd/socklnd.h
+++ b/net/lnet/klnds/socklnd/socklnd.h
@@ -263,7 +263,7 @@ struct ksock_nal_data {
  * received into struct bio_vec fragments.
  */
 struct ksock_conn;				/* forward ref */
-struct ksock_route;				/* forward ref */
+struct ksock_conn_cb;				/* forward ref */
 struct ksock_proto;				/* forward ref */
 
 struct ksock_tx {				/* transmit packet */
@@ -302,8 +302,10 @@ struct ksock_tx {				/* transmit packet */
 
 struct ksock_conn {
 	struct ksock_peer_ni   *ksnc_peer;		/* owning peer_ni */
-	struct ksock_route     *ksnc_route;		/* owning route */
-	struct list_head	ksnc_list;		/* stash on peer_ni's conn list */
+	struct ksock_conn_cb   *ksnc_conn_cb;		/* owning conn control
+							 * block
+							 */
+	struct list_head	ksnc_list;		/* on peer_ni's conn list */
 	struct socket	       *ksnc_sock;		/* actual socket */
 	void		       *ksnc_saved_data_ready;	/* socket's original
 							 * data_ready() callback
@@ -369,8 +371,7 @@ struct ksock_conn {
 							 */
 };
 
-struct ksock_route {
-	struct list_head	ksnr_list;		/* chain on peer_ni route list */
+struct ksock_conn_cb {
 	struct list_head	ksnr_connd_list;	/* chain on ksnr_connd_routes */
 	struct ksock_peer_ni   *ksnr_peer;		/* owning peer_ni */
 	refcount_t		ksnr_refcount;		/* # users */
@@ -388,7 +389,6 @@ struct ksock_route {
 							 * type
 							 */
 	unsigned int		ksnr_deleted:1;		/* been removed from peer_ni? */
-	unsigned int		ksnr_share_count;	/* created explicitly? */
 	int			ksnr_conn_count;	/* # conns established by this
 							 * route
 							 */
@@ -415,7 +415,7 @@ struct ksock_peer_ni {
 							 * protocol
 							 */
 	struct list_head	ksnp_conns;		/* all active connections */
-	struct list_head	ksnp_routes;		/* routes */
+	struct ksock_conn_cb	*ksnp_conn_cb;		/* conn control block */
 	struct list_head	ksnp_tx_queue;		/* waiting packets */
 	spinlock_t		ksnp_lock;		/* serialize, g_lock unsafe */
 	struct list_head	ksnp_zc_req_list;	/* zero copy requests wait for
@@ -495,7 +495,7 @@ struct ksock_proto {
 #endif
 
 static inline int
-ksocknal_route_mask(void)
+ksocknal_conn_cb_mask(void)
 {
 	if (!*ksocknal_tunables.ksnd_typed_conns)
 		return (1 << SOCKLND_CONN_ANY);
@@ -564,18 +564,18 @@ struct ksock_proto {
 }
 
 static inline void
-ksocknal_route_addref(struct ksock_route *route)
+ksocknal_conn_cb_addref(struct ksock_conn_cb *conn_cb)
 {
-	refcount_inc(&route->ksnr_refcount);
+	refcount_inc(&conn_cb->ksnr_refcount);
 }
 
-void ksocknal_destroy_route(struct ksock_route *route);
+void ksocknal_destroy_conn_cb(struct ksock_conn_cb *conn_cb);
 
 static inline void
-ksocknal_route_decref(struct ksock_route *route)
+ksocknal_conn_cb_decref(struct ksock_conn_cb *conn_cb)
 {
-	if (refcount_dec_and_test(&route->ksnr_refcount))
-		ksocknal_destroy_route(route);
+	if (refcount_dec_and_test(&conn_cb->ksnr_refcount))
+		ksocknal_destroy_conn_cb(conn_cb);
 }
 
 static inline void
@@ -615,7 +615,7 @@ struct ksock_peer_ni *ksocknal_find_peer_locked(struct lnet_ni *ni,
 struct ksock_peer_ni *ksocknal_find_peer(struct lnet_ni *ni,
 				         struct lnet_process_id id);
 void ksocknal_peer_failed(struct ksock_peer_ni *peer_ni);
-int ksocknal_create_conn(struct lnet_ni *ni, struct ksock_route *route,
+int ksocknal_create_conn(struct lnet_ni *ni, struct ksock_conn_cb *conn_cb,
 			 struct socket *sock, int type);
 void ksocknal_close_conn_locked(struct ksock_conn *conn, int why);
 void ksocknal_terminate_conn(struct ksock_conn *conn);
@@ -639,10 +639,10 @@ int ksocknal_launch_packet(struct lnet_ni *ni, struct ksock_tx *tx,
 int ksocknal_thread_start(int (*fn)(void *arg), void *arg, char *name);
 void ksocknal_thread_fini(void);
 void ksocknal_launch_all_connections_locked(struct ksock_peer_ni *peer_ni);
-struct ksock_route *
-ksocknal_find_connectable_route_locked(struct ksock_peer_ni *peer_ni);
-struct ksock_route *
-ksocknal_find_connecting_route_locked(struct ksock_peer_ni *peer_ni);
+struct ksock_conn_cb *
+ksocknal_find_connectable_conn_cb_locked(struct ksock_peer_ni *peer_ni);
+struct ksock_conn_cb *
+ksocknal_find_connecting_conn_cb_locked(struct ksock_peer_ni *peer_ni);
 int ksocknal_new_packet(struct ksock_conn *conn, int skip);
 int ksocknal_scheduler(void *arg);
 int ksocknal_connd(void *arg);
diff --git a/net/lnet/klnds/socklnd/socklnd_cb.c b/net/lnet/klnds/socklnd/socklnd_cb.c
index bfc4e2e..43658b2 100644
--- a/net/lnet/klnds/socklnd/socklnd_cb.c
+++ b/net/lnet/klnds/socklnd/socklnd_cb.c
@@ -556,19 +556,20 @@ struct ksock_tx *
 }
 
 static void
-ksocknal_launch_connection_locked(struct ksock_route *route)
+ksocknal_launch_connection_locked(struct ksock_conn_cb *conn_cb)
 {
 	/* called holding write lock on ksnd_global_lock */
-	LASSERT(!route->ksnr_scheduled);
-	LASSERT(!route->ksnr_connecting);
-	LASSERT(ksocknal_route_mask() & ~route->ksnr_connected);
+	LASSERT(!conn_cb->ksnr_scheduled);
+	LASSERT(!conn_cb->ksnr_connecting);
+	LASSERT(ksocknal_conn_cb_mask() & ~conn_cb->ksnr_connected);
 
-	route->ksnr_scheduled = 1;	/* scheduling conn for connd */
-	ksocknal_route_addref(route);	/* extra ref for connd */
+	/* scheduling conn for connd */
+	conn_cb->ksnr_scheduled = 1;
+	ksocknal_conn_cb_addref(conn_cb);
 
 	spin_lock_bh(&ksocknal_data.ksnd_connd_lock);
 
-	list_add_tail(&route->ksnr_connd_list,
+	list_add_tail(&conn_cb->ksnr_connd_list,
 		      &ksocknal_data.ksnd_connd_routes);
 	wake_up(&ksocknal_data.ksnd_connd_waitq);
 
@@ -578,16 +579,16 @@ struct ksock_tx *
 void
 ksocknal_launch_all_connections_locked(struct ksock_peer_ni *peer_ni)
 {
-	struct ksock_route *route;
+	struct ksock_conn_cb *conn_cb;
 
 	/* called holding write lock on ksnd_global_lock */
 	for (;;) {
 		/* launch any/all connections that need it */
-		route = ksocknal_find_connectable_route_locked(peer_ni);
-		if (!route)
+		conn_cb = ksocknal_find_connectable_conn_cb_locked(peer_ni);
+		if (!conn_cb)
 			return;
 
-		ksocknal_launch_connection_locked(route);
+		ksocknal_launch_connection_locked(conn_cb);
 	}
 }
 
@@ -753,53 +754,52 @@ struct ksock_conn *
 	spin_unlock_bh(&sched->kss_lock);
 }
 
-struct ksock_route *
-ksocknal_find_connectable_route_locked(struct ksock_peer_ni *peer_ni)
+struct ksock_conn_cb *
+ksocknal_find_connectable_conn_cb_locked(struct ksock_peer_ni *peer_ni)
 {
 	time64_t now = ktime_get_seconds();
-	struct ksock_route *route;
+	struct ksock_conn_cb *conn_cb;
 
-	list_for_each_entry(route, &peer_ni->ksnp_routes, ksnr_list) {
-		LASSERT(!route->ksnr_connecting || route->ksnr_scheduled);
+	conn_cb = peer_ni->ksnp_conn_cb;
+	if (!conn_cb)
+		return NULL;
 
-		/* connections being established */
-		if (route->ksnr_scheduled)
-			continue;
+	LASSERT(!conn_cb->ksnr_connecting || conn_cb->ksnr_scheduled);
 
-		/* all route types connected ? */
-		if (!(ksocknal_route_mask() & ~route->ksnr_connected))
-			continue;
+	/* connections being established */
+	if (conn_cb->ksnr_scheduled)
+		return NULL;
 
-		if (!(!route->ksnr_retry_interval || /* first attempt */
-		      now >= route->ksnr_timeout)) {
-			CDEBUG(D_NET,
-			       "Too soon to retry route %pIS (cnted %d, interval %lld, %lld secs later)\n",
-			       &route->ksnr_addr,
-			       route->ksnr_connected,
-			       route->ksnr_retry_interval,
-			       route->ksnr_timeout - now);
-			continue;
-		}
+	/* all conn types connected ? */
+	if (!(ksocknal_conn_cb_mask() & ~conn_cb->ksnr_connected))
+		return NULL;
 
-		return route;
+	if (!(conn_cb->ksnr_retry_interval == 0 || /* first attempt */
+	      now >= conn_cb->ksnr_timeout)) {
+		CDEBUG(D_NET,
+		       "Too soon to retry route %pIS (cnted %d, interval %lld, %lld secs later)\n",
+		       &conn_cb->ksnr_addr,
+		       conn_cb->ksnr_connected,
+		       conn_cb->ksnr_retry_interval,
+		       conn_cb->ksnr_timeout - now);
+		return NULL;
 	}
 
-	return NULL;
+	return conn_cb;
 }
 
-struct ksock_route *
-ksocknal_find_connecting_route_locked(struct ksock_peer_ni *peer_ni)
+struct ksock_conn_cb *
+ksocknal_find_connecting_conn_cb_locked(struct ksock_peer_ni *peer_ni)
 {
-	struct ksock_route *route;
+	struct ksock_conn_cb *conn_cb;
 
-	list_for_each_entry(route, &peer_ni->ksnp_routes, ksnr_list) {
-		LASSERT(!route->ksnr_connecting || route->ksnr_scheduled);
+	conn_cb = peer_ni->ksnp_conn_cb;
+	if (!conn_cb)
+		return NULL;
 
-		if (route->ksnr_scheduled)
-			return route;
-	}
+	LASSERT(!conn_cb->ksnr_connecting || conn_cb->ksnr_scheduled);
 
-	return NULL;
+	return conn_cb->ksnr_scheduled ? conn_cb : NULL;
 }
 
 int
@@ -820,12 +820,11 @@ struct ksock_route *
 		read_lock(g_lock);
 		peer_ni = ksocknal_find_peer_locked(ni, id);
 		if (peer_ni) {
-			if (!ksocknal_find_connectable_route_locked(peer_ni)) {
+			if (!ksocknal_find_connectable_conn_cb_locked(peer_ni)) {
 				conn = ksocknal_find_conn_locked(peer_ni, tx,
 								 tx->tx_nonblk);
 				if (conn) {
-					/*
-					 * I've got no routes that need to be
+					/* I've got nothing that need to be
 					 * connecting and I do have an actual
 					 * connection...
 					 */
@@ -879,7 +878,7 @@ struct ksock_route *
 	}
 
 	if (peer_ni->ksnp_accepting > 0 ||
-	    ksocknal_find_connecting_route_locked(peer_ni)) {
+	    ksocknal_find_connecting_conn_cb_locked(peer_ni)) {
 		/* the message is going to be pinned to the peer_ni */
 		tx->tx_deadline = ktime_get_seconds() +
 				  ksocknal_timeout();
@@ -1771,10 +1770,10 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 }
 
 static bool
-ksocknal_connect(struct ksock_route *route)
+ksocknal_connect(struct ksock_conn_cb *conn_cb)
 {
 	LIST_HEAD(zombies);
-	struct ksock_peer_ni *peer_ni = route->ksnr_peer;
+	struct ksock_peer_ni *peer_ni = conn_cb->ksnr_peer;
 	int type;
 	int wanted;
 	struct socket *sock;
@@ -1786,19 +1785,18 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 
 	write_lock_bh(&ksocknal_data.ksnd_global_lock);
 
-	LASSERT(route->ksnr_scheduled);
-	LASSERT(!route->ksnr_connecting);
+	LASSERT(conn_cb->ksnr_scheduled);
+	LASSERT(!conn_cb->ksnr_connecting);
 
-	route->ksnr_connecting = 1;
+	conn_cb->ksnr_connecting = 1;
 
 	for (;;) {
-		wanted = ksocknal_route_mask() & ~route->ksnr_connected;
+		wanted = ksocknal_conn_cb_mask() & ~conn_cb->ksnr_connected;
 
-		/*
-		 * stop connecting if peer_ni/route got closed under me, or
-		 * route got connected while queued
+		/* stop connecting if peer_ni/cb got closed under me, or
+		 * conn_cb got connected while queued
 		 */
-		if (peer_ni->ksnp_closing || route->ksnr_deleted ||
+		if (peer_ni->ksnp_closing || conn_cb->ksnr_deleted ||
 		    !wanted) {
 			retry_later = false;
 			break;
@@ -1833,24 +1831,25 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 			rc = -ETIMEDOUT;
 			lnet_connect_console_error(rc, peer_ni->ksnp_id.nid,
 						   (struct sockaddr *)
-						   &route->ksnr_addr);
+						   &conn_cb->ksnr_addr);
 			goto failed;
 		}
 
 		sock = lnet_connect(peer_ni->ksnp_id.nid,
-				    route->ksnr_myiface,
-				    (struct sockaddr *)&route->ksnr_addr,
+				    conn_cb->ksnr_myiface,
+				    (struct sockaddr *)&conn_cb->ksnr_addr,
 				    peer_ni->ksnp_ni->ni_net_ns);
 		if (IS_ERR(sock)) {
 			rc = PTR_ERR(sock);
 			goto failed;
 		}
 
-		rc = ksocknal_create_conn(peer_ni->ksnp_ni, route, sock, type);
+		rc = ksocknal_create_conn(peer_ni->ksnp_ni, conn_cb, sock,
+					  type);
 		if (rc < 0) {
 			lnet_connect_console_error(rc, peer_ni->ksnp_id.nid,
 						   (struct sockaddr *)
-						   &route->ksnr_addr);
+						   &conn_cb->ksnr_addr);
 			goto failed;
 		}
 
@@ -1866,8 +1865,8 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 		write_lock_bh(&ksocknal_data.ksnd_global_lock);
 	}
 
-	route->ksnr_scheduled = 0;
-	route->ksnr_connecting = 0;
+	conn_cb->ksnr_scheduled = 0;
+	conn_cb->ksnr_connecting = 0;
 
 	if (retry_later) {
 		/*
@@ -1882,13 +1881,13 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 			 * but the race is resolved quickly usually,
 			 * so min_reconnectms should be good heuristic
 			 */
-			route->ksnr_retry_interval =
+			conn_cb->ksnr_retry_interval =
 				*ksocknal_tunables.ksnd_min_reconnectms / 1000;
-			route->ksnr_timeout = ktime_get_seconds() +
-					      route->ksnr_retry_interval;
+			conn_cb->ksnr_timeout = ktime_get_seconds() +
+						conn_cb->ksnr_retry_interval;
 		}
 
-		ksocknal_launch_connection_locked(route);
+		ksocknal_launch_connection_locked(conn_cb);
 	}
 
 	write_unlock_bh(&ksocknal_data.ksnd_global_lock);
@@ -1897,24 +1896,25 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 failed:
 	write_lock_bh(&ksocknal_data.ksnd_global_lock);
 
-	route->ksnr_scheduled = 0;
-	route->ksnr_connecting = 0;
+	conn_cb->ksnr_scheduled = 0;
+	conn_cb->ksnr_connecting = 0;
 
 	/* This is a retry rather than a new connection */
-	route->ksnr_retry_interval *= 2;
-	route->ksnr_retry_interval =
-		max_t(time64_t, route->ksnr_retry_interval,
+	conn_cb->ksnr_retry_interval *= 2;
+	conn_cb->ksnr_retry_interval =
+		max_t(time64_t, conn_cb->ksnr_retry_interval,
 		      *ksocknal_tunables.ksnd_min_reconnectms / 1000);
-	route->ksnr_retry_interval =
-		min_t(time64_t, route->ksnr_retry_interval,
+	conn_cb->ksnr_retry_interval =
+		min_t(time64_t, conn_cb->ksnr_retry_interval,
 		      *ksocknal_tunables.ksnd_max_reconnectms / 1000);
 
-	LASSERT(route->ksnr_retry_interval);
-	route->ksnr_timeout = ktime_get_seconds() + route->ksnr_retry_interval;
+	LASSERT(conn_cb->ksnr_retry_interval);
+	conn_cb->ksnr_timeout = ktime_get_seconds() +
+				conn_cb->ksnr_retry_interval;
 
 	if (!list_empty(&peer_ni->ksnp_tx_queue) &&
 	    !peer_ni->ksnp_accepting &&
-	    !ksocknal_find_connecting_route_locked(peer_ni)) {
+	    !ksocknal_find_connecting_conn_cb_locked(peer_ni)) {
 		struct ksock_conn *conn;
 
 		/*
@@ -2045,26 +2045,28 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 	       ksocknal_data.ksnd_connd_connecting + SOCKNAL_CONND_RESV;
 }
 
-/*
- * Go through connd_routes queue looking for a route that we can process
+/* Go through connd_cbs queue looking for a conn_cb that we can process
  * right now, @timeout_p can be updated if we need to come back later
  */
-static struct ksock_route *
-ksocknal_connd_get_route_locked(signed long *timeout_p)
+static struct ksock_conn_cb *
+ksocknal_connd_get_conn_cb_locked(signed long *timeout_p)
 {
 	time64_t now = ktime_get_seconds();
-	struct ksock_route *route;
+	time64_t conn_timeout;
+	struct ksock_conn_cb *conn_cb;
 
-	/* connd_routes can contain both pending and ordinary routes */
-	list_for_each_entry(route, &ksocknal_data.ksnd_connd_routes,
+	/* connd_cb can contain both pending and ordinary conn_cb */
+	list_for_each_entry(conn_cb, &ksocknal_data.ksnd_connd_routes,
 			    ksnr_connd_list) {
-		if (!route->ksnr_retry_interval ||
-		    now >= route->ksnr_timeout)
-			return route;
+		conn_timeout = conn_cb->ksnr_timeout;
+
+		if (!conn_cb->ksnr_retry_interval ||
+		    now >= conn_cb->ksnr_timeout)
+			return conn_cb;
 
 		if (*timeout_p == MAX_SCHEDULE_TIMEOUT ||
-		    *timeout_p > (signed long)(route->ksnr_timeout - now) * HZ)
-			*timeout_p = (signed long)(route->ksnr_timeout - now) * HZ;
+		    *timeout_p > (signed long)(conn_timeout - now) * HZ)
+			*timeout_p = (signed long)(conn_timeout - now) * HZ;
 	}
 
 	return NULL;
@@ -2087,7 +2089,7 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 	ksocknal_data.ksnd_connd_running++;
 
 	while (!ksocknal_data.ksnd_shuttingdown) {
-		struct ksock_route *route = NULL;
+		struct ksock_conn_cb *conn_cb = NULL;
 		time64_t sec = ktime_get_real_seconds();
 		long timeout = MAX_SCHEDULE_TIMEOUT;
 		bool dropped_lock = false;
@@ -2126,27 +2128,27 @@ void ksocknal_write_callback(struct ksock_conn *conn)
 		 * create new connd
 		 */
 		if (ksocknal_data.ksnd_connd_connecting + SOCKNAL_CONND_RESV <
-		    ksocknal_data.ksnd_connd_running) {
-			route = ksocknal_connd_get_route_locked(&timeout);
-		}
-		if (route) {
-			list_del(&route->ksnr_connd_list);
+		    ksocknal_data.ksnd_connd_running)
+			conn_cb = ksocknal_connd_get_conn_cb_locked(&timeout);
+
+		if (conn_cb) {
+			list_del(&conn_cb->ksnr_connd_list);
 			ksocknal_data.ksnd_connd_connecting++;
 			spin_unlock_bh(connd_lock);
 			dropped_lock = true;
 
-			if (ksocknal_connect(route)) {
+			if (ksocknal_connect(conn_cb)) {
 				/* consecutive retry */
 				if (cons_retry++ > SOCKNAL_INSANITY_RECONN) {
 					CWARN("massive consecutive re-connecting to %pIS\n",
-					      &route->ksnr_addr);
+					      &conn_cb->ksnr_addr);
 					cons_retry = 0;
 				}
 			} else {
 				cons_retry = 0;
 			}
 
-			ksocknal_route_decref(route);
+			ksocknal_conn_cb_decref(conn_cb);
 
 			spin_lock_bh(connd_lock);
 			ksocknal_data.ksnd_connd_connecting--;
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 07/29] lustre: readahead: limit over reservation
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (5 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 06/29] lnet: socklnd: replace route construct James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 08/29] lustre: clio: fix hang on urgent cached pages James Simmons
                   ` (21 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown
  Cc: Wang Shilong, Lustre Development List

From: Wang Shilong <wshilong@ddn.com>

For performance reason, exceeding @ra_max_pages are allowed to
cover current read window, but this should be limited with RPC
size in case a large block size read issued. Trim to RPC boundary.

Otherwise, too many read ahead pages might be issued and
make client short of LRU pages.

Fixes: 35b7c43c21 ("lustre: llite: allow current readahead to exceed reservation")
WC-bug-id: https://jira.whamcloud.com/browse/LU-12142
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/42060
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/llite/lproc_llite.c | 10 ++++++++--
 fs/lustre/llite/rw.c          |  8 ++++++++
 2 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/fs/lustre/llite/lproc_llite.c b/fs/lustre/llite/lproc_llite.c
index ec241a4..4ce6fab 100644
--- a/fs/lustre/llite/lproc_llite.c
+++ b/fs/lustre/llite/lproc_llite.c
@@ -455,6 +455,7 @@ static int ll_max_cached_mb_seq_show(struct seq_file *m, void *v)
 	struct super_block *sb = m->private;
 	struct ll_sb_info *sbi = ll_s2sbi(sb);
 	struct cl_client_cache *cache = sbi->ll_cache;
+	struct ll_ra_info *ra = &sbi->ll_ra_info;
 	long max_cached_mb;
 	long unused_mb;
 
@@ -462,17 +463,22 @@ static int ll_max_cached_mb_seq_show(struct seq_file *m, void *v)
 	max_cached_mb = PAGES_TO_MiB(cache->ccc_lru_max);
 	unused_mb = PAGES_TO_MiB(atomic_long_read(&cache->ccc_lru_left));
 	mutex_unlock(&cache->ccc_max_cache_mb_lock);
+
 	seq_printf(m,
 		   "users: %d\n"
 		   "max_cached_mb: %ld\n"
 		   "used_mb: %ld\n"
 		   "unused_mb: %ld\n"
-		   "reclaim_count: %u\n",
+		   "reclaim_count: %u\n"
+		   "max_read_ahead_mb: %lu\n"
+		   "used_read_ahead_mb: %d\n",
 		   refcount_read(&cache->ccc_users),
 		   max_cached_mb,
 		   max_cached_mb - unused_mb,
 		   unused_mb,
-		   cache->ccc_lru_shrinkers);
+		   cache->ccc_lru_shrinkers,
+		   PAGES_TO_MiB(ra->ra_max_pages),
+		   PAGES_TO_MiB(atomic_read(&ra->ra_cur_pages)));
 	return 0;
 }
 
diff --git a/fs/lustre/llite/rw.c b/fs/lustre/llite/rw.c
index 8bba97f..2d08767 100644
--- a/fs/lustre/llite/rw.c
+++ b/fs/lustre/llite/rw.c
@@ -788,6 +788,14 @@ static int ll_readahead(const struct lu_env *env, struct cl_io *io,
 			vio->vui_ra_start_idx + vio->vui_ra_pages - 1;
 		pages_min = vio->vui_ra_start_idx + vio->vui_ra_pages -
 			    ria->ria_start_idx;
+		/**
+		 * For performance reason, exceeding @ra_max_pages
+		 * are allowed, but this should be limited with RPC
+		 * size in case a large block size read issued. Trim
+		 * to RPC boundary.
+		 */
+		pages_min = min(pages_min, ras->ras_rpc_pages -
+				(ria->ria_start_idx % ras->ras_rpc_pages));
 	}
 
 	/* don't over reserved for mmap range read */
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 08/29] lustre: clio: fix hang on urgent cached pages
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (6 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 07/29] lustre: readahead: limit over reservation James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 09/29] lustre: uapi: add mdt_hash_name James Simmons
                   ` (20 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown
  Cc: Wang Shilong, Lustre Development List

From: Wang Shilong <wshilong@ddn.com>

Few problems addressed by this patch:

1) We try to reserve cl_pages in batch, but we don't do
   that for append IO, there is no reason to skip that.

2) IO might be not page aligned, calculate reserved pages
   correctly for this case.

3) If we issue one large IO block size which is larger
   than max_cached_mb, IO will never be finished, because
   we don't have enough cl pages to finish it, split IO
   in this case.

4) Readahead should fail if we are short of LRU page
   slots to avoid deadlock.

After above adjustment, LRU slots are guranteed for normal
buffer write before IO starts, if block size is too large
for max LRU slots, IO will be split.

For extra readahead, don't try hard and quit if we
are short of LRU pages, since readahead could tolerate
errors, applications won't be aware of it.

besides newly added tests, following command with 64M
max_cached_mb setting and don't see client hang any more.

/usr/lib64/openmpi/bin/mpirun --allow-run-as-root -np 12
-wd /mnt/lustre ior -g -e -w -r -b 1g -T 10 -F -C -t 64m

Todo:
Performance benchmark for readahead

WC-bug-id: https://jira.whamcloud.com/browse/LU-12142
Lustre-commit: 2a34dc95bd100c181 ("LU-12142 clio: fix hang on urgent cached pages")
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/40237
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/include/cl_object.h  | 16 ++++++++---
 fs/lustre/include/lustre_osc.h | 10 ++++---
 fs/lustre/llite/file.c         | 36 ++++++++++++++++++++++---
 fs/lustre/llite/rw.c           | 31 ++++++++++++++++++++-
 fs/lustre/llite/vvp_io.c       | 12 +++++++++
 fs/lustre/lov/lov_io.c         | 53 ++++++++++++++++++++++++++++++++++++
 fs/lustre/mdc/mdc_dev.c        | 10 ++++---
 fs/lustre/obdclass/cl_io.c     | 28 +++++++++++++++++++
 fs/lustre/osc/osc_io.c         | 61 ++++++++++++++++++++++++------------------
 fs/lustre/osc/osc_page.c       | 38 ++++++++++++++++++++------
 10 files changed, 247 insertions(+), 48 deletions(-)

diff --git a/fs/lustre/include/cl_object.h b/fs/lustre/include/cl_object.h
index b36942a..6554e3d 100644
--- a/fs/lustre/include/cl_object.h
+++ b/fs/lustre/include/cl_object.h
@@ -1490,9 +1490,10 @@ struct cl_read_ahead {
 	 * function should be called to release it.
 	 */
 	void				(*cra_release)(const struct lu_env *env,
-						       void *cbdata);
+						       struct cl_read_ahead *ra);
 	/* Callback data for cra_release routine */
-	void				*cra_cbdata;
+	void				*cra_dlmlock;
+	void				*cra_oio;
 	/* whether lock is in contention */
 	bool				cra_contention;
 };
@@ -1501,7 +1502,7 @@ static inline void cl_read_ahead_release(const struct lu_env *env,
 					 struct cl_read_ahead *ra)
 {
 	if (ra->cra_release)
-		ra->cra_release(env, ra->cra_cbdata);
+		ra->cra_release(env, ra);
 	memset(ra, 0, sizeof(*ra));
 }
 
@@ -1624,6 +1625,13 @@ struct cl_io_operations {
 			      const struct cl_io_slice *slice,
 			      pgoff_t start, struct cl_read_ahead *ra);
 	/**
+	 *
+	 * Reserve LRU slots before IO.
+	 */
+	int (*cio_lru_reserve)(const struct lu_env *env,
+			       const struct cl_io_slice *slice,
+			       loff_t pos, size_t bytes);
+	/**
 	 * Optional debugging helper. Print given io slice.
 	 */
 	int (*cio_print)(const struct lu_env *env, void *cookie,
@@ -2445,6 +2453,8 @@ int cl_io_commit_async(const struct lu_env *env, struct cl_io *io,
 		       struct cl_page_list *queue, int from, int to,
 		       cl_commit_cbt cb);
 void cl_io_extent_release(const struct lu_env *env, struct cl_io *io);
+int cl_io_lru_reserve(const struct lu_env *env, struct cl_io *io,
+		      loff_t pos, size_t bytes);
 int cl_io_read_ahead(const struct lu_env *env, struct cl_io *io,
 		     pgoff_t start, struct cl_read_ahead *ra);
 
diff --git a/fs/lustre/include/lustre_osc.h b/fs/lustre/include/lustre_osc.h
index 4575956..17bfbfb 100644
--- a/fs/lustre/include/lustre_osc.h
+++ b/fs/lustre/include/lustre_osc.h
@@ -142,7 +142,9 @@ struct osc_io {
 	/* true if this io is counted as active IO */
 				oi_is_active:1,
 	/** true if this io has CAP_SYS_RESOURCE */
-				oi_cap_sys_resource:1;
+				oi_cap_sys_resource:1,
+	/** true if this io issued by readahead */
+				oi_is_readahead:1;
 	/* how many LRU pages are reserved for this IO */
 	unsigned long		oi_lru_reserved;
 
@@ -694,8 +696,6 @@ void osc_io_extent_release(const struct lu_env *env,
 int osc_io_iter_init(const struct lu_env *env, const struct cl_io_slice *ios);
 void osc_io_iter_fini(const struct lu_env *env,
 		      const struct cl_io_slice *ios);
-int osc_io_rw_iter_init(const struct lu_env *env,
-			const struct cl_io_slice *ios);
 void osc_io_rw_iter_fini(const struct lu_env *env,
 			    const struct cl_io_slice *ios);
 int osc_io_fault_start(const struct lu_env *env, const struct cl_io_slice *ios);
@@ -710,11 +710,13 @@ int osc_fsync_ost(const struct lu_env *env, struct osc_object *obj,
 		  struct cl_fsync_io *fio);
 void osc_io_fsync_end(const struct lu_env *env,
 		      const struct cl_io_slice *slice);
-void osc_read_ahead_release(const struct lu_env *env, void *cbdata);
+void osc_read_ahead_release(const struct lu_env *env, struct cl_read_ahead *ra);
 int osc_io_lseek_start(const struct lu_env *env,
 		       const struct cl_io_slice *slice);
 void osc_io_lseek_end(const struct lu_env *env,
 		      const struct cl_io_slice *slice);
+int osc_io_lru_reserve(const struct lu_env *env, const struct cl_io_slice *ios,
+		       loff_t pos, size_t count);
 
 /* osc_lock.c */
 void osc_lock_to_lockless(const struct lu_env *env, struct osc_lock *ols,
diff --git a/fs/lustre/llite/file.c b/fs/lustre/llite/file.c
index 2558a60..e9f0fc9 100644
--- a/fs/lustre/llite/file.c
+++ b/fs/lustre/llite/file.c
@@ -1564,8 +1564,10 @@ static void ll_heat_add(struct inode *inode, enum cl_io_type iot,
 		   struct file *file, enum cl_io_type iot,
 		   loff_t *ppos, size_t count)
 {
-	struct ll_inode_info *lli = ll_i2info(file_inode(file));
+	struct inode *inode = file_inode(file);
+	struct ll_inode_info *lli = ll_i2info(inode);
 	struct ll_file_data *fd = file->private_data;
+	struct ll_sb_info *sbi = ll_i2sbi(inode);
 	struct vvp_io *vio = vvp_env_io(env);
 	struct range_lock range;
 	struct cl_io *io;
@@ -1575,10 +1577,18 @@ static void ll_heat_add(struct inode *inode, enum cl_io_type iot,
 	unsigned int dio_lock = 0;
 	bool is_aio = false;
 	struct cl_dio_aio *ci_aio = NULL;
+	size_t per_bytes;
+	bool partial_io = false;
+	size_t max_io_pages, max_cached_pages;
 
 	CDEBUG(D_VFSTRACE, "file: %pD, type: %d ppos: %llu, count: %zu\n",
 	       file, iot, *ppos, count);
 
+	max_io_pages = PTLRPC_MAX_BRW_PAGES * OBD_MAX_RIF_DEFAULT;
+	max_cached_pages = sbi->ll_cache->ccc_lru_max;
+	if (max_io_pages > (max_cached_pages >> 2))
+		max_io_pages = max_cached_pages >> 2;
+
 	io = vvp_env_thread_io(env);
 	if (file->f_flags & O_DIRECT) {
 		if (!is_sync_kiocb(args->u.normal.via_iocb))
@@ -1591,19 +1601,29 @@ static void ll_heat_add(struct inode *inode, enum cl_io_type iot,
 	}
 
 restart:
+	/**
+	 * IO block size need be aware of cached page limit, otherwise
+	 * if we have small max_cached_mb but large block IO issued, io
+	 * could not be finished and blocked whole client.
+	 */
+	if (file->f_flags & O_DIRECT)
+		per_bytes = count;
+	else
+		per_bytes = min(max_io_pages << PAGE_SHIFT, count);
+	partial_io = per_bytes < count;
 	io = vvp_env_thread_io(env);
 	ll_io_init(io, file, iot == CIT_WRITE, args);
 	io->ci_aio = ci_aio;
 	io->ci_dio_lock = dio_lock;
 	io->ci_ndelay_tried = retried;
 
-	if (cl_io_rw_init(env, io, iot, *ppos, count) == 0) {
+	if (cl_io_rw_init(env, io, iot, *ppos, per_bytes) == 0) {
 		bool range_locked = false;
 
 		if (file->f_flags & O_APPEND)
 			range_lock_init(&range, 0, LUSTRE_EOF);
 		else
-			range_lock_init(&range, *ppos, *ppos + count - 1);
+			range_lock_init(&range, *ppos, *ppos + per_bytes - 1);
 
 		vio->vui_fd  = file->private_data;
 		vio->vui_iter = args->u.normal.via_iter;
@@ -1656,6 +1676,16 @@ static void ll_heat_add(struct inode *inode, enum cl_io_type iot,
 		/* prepare IO restart */
 		if (count > 0)
 			args->u.normal.via_iter = vio->vui_iter;
+
+		if (partial_io) {
+			/**
+			 * Reexpand iov count because it was zero
+			 * after IO finish.
+			 */
+			iov_iter_reexpand(vio->vui_iter, count);
+			if (per_bytes == io->ci_nob)
+				io->ci_need_restart = 1;
+		}
 	}
 out:
 	cl_io_fini(env, io);
diff --git a/fs/lustre/llite/rw.c b/fs/lustre/llite/rw.c
index 2d08767..c64696d 100644
--- a/fs/lustre/llite/rw.c
+++ b/fs/lustre/llite/rw.c
@@ -86,7 +86,14 @@ static unsigned long ll_ra_count_get(struct ll_sb_info *sbi,
 	struct ll_ra_info *ra = &sbi->ll_ra_info;
 	long ret;
 
-	/* If read-ahead pages left are less than 1M, do not do read-ahead,
+	/**
+	 * Don't try readahead agreesively if we are limited
+	 * LRU pages, otherwise, it could cause deadlock.
+	 */
+	pages = min(sbi->ll_cache->ccc_lru_max >> 2, pages);
+
+	/*
+	 * If read-ahead pages left are less than 1M, do not do read-ahead,
 	 * otherwise it will form small read RPC(< 1M), which hurt server
 	 * performance a lot.
 	 */
@@ -701,11 +708,24 @@ static int ll_readahead(const struct lu_env *env, struct cl_io *io,
 	struct inode *inode;
 	struct ra_io_arg *ria = &lti->lti_ria;
 	struct cl_object *clob;
+	struct ll_sb_info *sbi;
+	struct ll_ra_info *ra;
 	int ret = 0;
 	u64 kms;
 
 	clob = io->ci_obj;
 	inode = vvp_object_inode(clob);
+	sbi = ll_i2sbi(inode);
+	ra = &sbi->ll_ra_info;
+
+	/**
+	 * In case we have a limited max_cached_mb, readahead
+	 * should be stopped if it have run out of all LRU slots.
+	 */
+	if (atomic_read(&ra->ra_cur_pages) >= sbi->ll_cache->ccc_lru_max) {
+		ll_ra_stats_inc(inode, RA_STAT_MAX_IN_FLIGHT);
+		return 0;
+	}
 
 	memset(ria, 0, sizeof(*ria));
 	ret = ll_readahead_file_kms(env, io, &kms);
@@ -1706,6 +1726,15 @@ static int kickoff_async_readahead(struct file *file, unsigned long pages)
 	pgoff_t start_idx = ras_align(ras, ras->ras_next_readahead_idx);
 	pgoff_t end_idx = start_idx + pages - 1;
 
+	/**
+	 * In case we have a limited max_cached_mb, readahead
+	 * should be stopped if it have run out of all LRU slots.
+	 */
+	if (atomic_read(&ra->ra_cur_pages) >= sbi->ll_cache->ccc_lru_max) {
+		ll_ra_stats_inc(inode, RA_STAT_MAX_IN_FLIGHT);
+		return 0;
+	}
+
 	throttle = min(ra->ra_async_pages_per_file_threshold,
 		       ra->ra_max_pages_per_file);
 	/*
diff --git a/fs/lustre/llite/vvp_io.c b/fs/lustre/llite/vvp_io.c
index ac6aef0..cb59e94 100644
--- a/fs/lustre/llite/vvp_io.c
+++ b/fs/lustre/llite/vvp_io.c
@@ -798,6 +798,12 @@ static int vvp_io_read_start(const struct lu_env *env,
 	if (!can_populate_pages(env, io, inode))
 		return 0;
 
+	if (!(file->f_flags & O_DIRECT)) {
+		result = cl_io_lru_reserve(env, io, pos, cnt);
+		if (result)
+			return result;
+	}
+
 	/* Unless this is reading a sparse file, otherwise the lock has already
 	 * been acquired so vvp_prep_size() is an empty op.
 	 */
@@ -1175,6 +1181,12 @@ static int vvp_io_write_start(const struct lu_env *env,
 	if (OBD_FAIL_CHECK(OBD_FAIL_LLITE_IMUTEX_NOSEC) && lock_inode)
 		return -EINVAL;
 
+	if (!(file->f_flags & O_DIRECT)) {
+		result = cl_io_lru_reserve(env, io, pos, cnt);
+		if (result)
+			return result;
+	}
+
 	if (!vio->vui_iter) {
 		/* from a temp io in ll_cl_init(). */
 		result = 0;
diff --git a/fs/lustre/lov/lov_io.c b/fs/lustre/lov/lov_io.c
index 9f67d16..ae9d547 100644
--- a/fs/lustre/lov/lov_io.c
+++ b/fs/lustre/lov/lov_io.c
@@ -1179,6 +1179,58 @@ static int lov_io_read_ahead(const struct lu_env *env,
 	return 0;
 }
 
+int lov_io_lru_reserve(const struct lu_env *env,
+		       const struct cl_io_slice *ios, loff_t pos, size_t bytes)
+{
+	struct lov_io *lio = cl2lov_io(env, ios);
+	struct lov_stripe_md *lsm = lio->lis_object->lo_lsm;
+	struct lov_io_sub *sub;
+	struct lu_extent ext;
+	int index;
+	int rc = 0;
+
+	ext.e_start = pos;
+	ext.e_end = pos + bytes;
+	lov_foreach_io_layout(index, lio, &ext) {
+		struct lov_layout_entry *le = lov_entry(lio->lis_object, index);
+		struct lov_layout_raid0 *r0 = &le->lle_raid0;
+		u64 start;
+		u64 end;
+		int stripe;
+
+		if (!lsm_entry_inited(lsm, index))
+			continue;
+
+		if (!le->lle_valid && !ios->cis_io->ci_designated_mirror) {
+			CERROR(DFID": I/O to invalid component: %d, mirror: %d\n",
+			       PFID(lu_object_fid(lov2lu(lio->lis_object))),
+			       index, lio->lis_mirror_index);
+			return -EIO;
+		}
+
+		for (stripe = 0; stripe < r0->lo_nr; stripe++) {
+			if (!lov_stripe_intersects(lsm, index, stripe,
+						   &ext, &start, &end))
+				continue;
+
+			if (unlikely(!r0->lo_sub[stripe]))
+				return -EIO;
+
+			sub = lov_sub_get(env, lio,
+					  lov_comp_index(index, stripe));
+			if (IS_ERR(sub))
+				return PTR_ERR(sub);
+
+			rc = cl_io_lru_reserve(sub->sub_env, &sub->sub_io,
+					       start, end - start + 1);
+			if (rc != 0)
+				return rc;
+		}
+	}
+
+	return 0;
+}
+
 /**
  * lov implementation of cl_operations::cio_submit() method. It takes a list
  * of pages in @queue, splits it into per-stripe sub-lists, invokes
@@ -1581,6 +1633,7 @@ static void lov_io_lseek_end(const struct lu_env *env,
 		}
 	},
 	.cio_read_ahead			= lov_io_read_ahead,
+	.cio_lru_reserve		= lov_io_lru_reserve,
 	.cio_submit			= lov_io_submit,
 	.cio_commit_async		= lov_io_commit_async,
 };
diff --git a/fs/lustre/mdc/mdc_dev.c b/fs/lustre/mdc/mdc_dev.c
index 39c1213..7807f9e 100644
--- a/fs/lustre/mdc/mdc_dev.c
+++ b/fs/lustre/mdc/mdc_dev.c
@@ -1113,12 +1113,14 @@ static int mdc_io_read_ahead(const struct lu_env *env,
 			     pgoff_t start, struct cl_read_ahead *ra)
 {
 	struct osc_object *osc = cl2osc(ios->cis_obj);
+	struct osc_io *oio = cl2osc_io(env, ios);
 	struct ldlm_lock *dlmlock;
 
 	dlmlock = mdc_dlmlock_at_pgoff(env, osc, start, 0);
 	if (!dlmlock)
 		return -ENODATA;
 
+	oio->oi_is_readahead = 1;
 	if (dlmlock->l_req_mode != LCK_PR) {
 		struct lustre_handle lockh;
 
@@ -1130,7 +1132,8 @@ static int mdc_io_read_ahead(const struct lu_env *env,
 	ra->cra_rpc_pages = osc_cli(osc)->cl_max_pages_per_rpc;
 	ra->cra_end_idx = CL_PAGE_EOF;
 	ra->cra_release = osc_read_ahead_release;
-	ra->cra_cbdata = dlmlock;
+	ra->cra_dlmlock = dlmlock;
+	ra->cra_oio = oio;
 
 	return 0;
 }
@@ -1287,12 +1290,12 @@ static void mdc_io_data_version_end(const struct lu_env *env,
 static const struct cl_io_operations mdc_io_ops = {
 	.op = {
 		[CIT_READ] = {
-			.cio_iter_init	= osc_io_rw_iter_init,
+			.cio_iter_init	= osc_io_iter_init,
 			.cio_iter_fini	= osc_io_rw_iter_fini,
 			.cio_start	= osc_io_read_start,
 		},
 		[CIT_WRITE] = {
-			.cio_iter_init	= osc_io_rw_iter_init,
+			.cio_iter_init	= osc_io_iter_init,
 			.cio_iter_fini	= osc_io_rw_iter_fini,
 			.cio_start	= osc_io_write_start,
 			.cio_end	= osc_io_end,
@@ -1323,6 +1326,7 @@ static void mdc_io_data_version_end(const struct lu_env *env,
 		},
 	},
 	.cio_read_ahead		= mdc_io_read_ahead,
+	.cio_lru_reserve	= osc_io_lru_reserve,
 	.cio_submit		= osc_io_submit,
 	.cio_commit_async	= osc_io_commit_async,
 	.cio_extent_release	= osc_io_extent_release,
diff --git a/fs/lustre/obdclass/cl_io.c b/fs/lustre/obdclass/cl_io.c
index 138ff27..27804d3 100644
--- a/fs/lustre/obdclass/cl_io.c
+++ b/fs/lustre/obdclass/cl_io.c
@@ -573,6 +573,34 @@ int cl_io_read_ahead(const struct lu_env *env, struct cl_io *io,
 EXPORT_SYMBOL(cl_io_read_ahead);
 
 /**
+ * Called before io start, to reserve enough LRU slots to avoid
+ * deadlock.
+ *
+ * \see cl_io_operations::cio_lru_reserve()
+ */
+int cl_io_lru_reserve(const struct lu_env *env, struct cl_io *io,
+		      loff_t pos, size_t bytes)
+{
+	const struct cl_io_slice *scan;
+	int result = 0;
+
+	LINVRNT(io->ci_type == CIT_READ || io->ci_type == CIT_WRITE);
+	LINVRNT(cl_io_invariant(io));
+
+	list_for_each_entry(scan, &io->ci_layers, cis_linkage) {
+		if (scan->cis_iop->cio_lru_reserve) {
+			result = scan->cis_iop->cio_lru_reserve(env, scan,
+								pos, bytes);
+			if (result)
+				break;
+		}
+	}
+
+	return result;
+}
+EXPORT_SYMBOL(cl_io_lru_reserve);
+
+/**
  * Commit a list of contiguous pages into writeback cache.
  *
  * \returns 0 if all pages committed, or errcode if error occurred.
diff --git a/fs/lustre/osc/osc_io.c b/fs/lustre/osc/osc_io.c
index b965608..9d783e0 100644
--- a/fs/lustre/osc/osc_io.c
+++ b/fs/lustre/osc/osc_io.c
@@ -59,11 +59,13 @@ static void osc_io_fini(const struct lu_env *env, const struct cl_io_slice *io)
 {
 }
 
-void osc_read_ahead_release(const struct lu_env *env, void *cbdata)
+void osc_read_ahead_release(const struct lu_env *env, struct cl_read_ahead *ra)
 {
-	struct ldlm_lock *dlmlock = cbdata;
+	struct ldlm_lock *dlmlock = ra->cra_dlmlock;
+	struct osc_io *oio = ra->cra_oio;
 	struct lustre_handle lockh;
 
+	oio->oi_is_readahead = 0;
 	ldlm_lock2handle(dlmlock, &lockh);
 	ldlm_lock_decref(&lockh, LCK_PR);
 	LDLM_LOCK_PUT(dlmlock);
@@ -75,9 +77,11 @@ static int osc_io_read_ahead(const struct lu_env *env,
 			     pgoff_t start, struct cl_read_ahead *ra)
 {
 	struct osc_object *osc = cl2osc(ios->cis_obj);
+	struct osc_io *oio = cl2osc_io(env, ios);
 	struct ldlm_lock *dlmlock;
 	int result = -ENODATA;
 
+	oio->oi_is_readahead = true;
 	dlmlock = osc_dlmlock_at_pgoff(env, osc, start, 0);
 	if (dlmlock) {
 		LASSERT(dlmlock->l_ast_data == osc);
@@ -93,7 +97,8 @@ static int osc_io_read_ahead(const struct lu_env *env,
 		ra->cra_end_idx = cl_index(osc2cl(osc),
 					   dlmlock->l_policy_data.l_extent.end);
 		ra->cra_release = osc_read_ahead_release;
-		ra->cra_cbdata = dlmlock;
+		ra->cra_dlmlock = dlmlock;
+		ra->cra_oio = oio;
 		if (ra->cra_end_idx != CL_PAGE_EOF)
 			ra->cra_contention = true;
 		result = 0;
@@ -421,27 +426,6 @@ int osc_io_iter_init(const struct lu_env *env, const struct cl_io_slice *ios)
 }
 EXPORT_SYMBOL(osc_io_iter_init);
 
-int osc_io_rw_iter_init(const struct lu_env *env,
-			const struct cl_io_slice *ios)
-{
-	struct cl_io *io = ios->cis_io;
-	struct osc_io *oio = osc_env_io(env);
-	struct osc_object *osc = cl2osc(ios->cis_obj);
-	unsigned long npages;
-
-	if (cl_io_is_append(io))
-		return osc_io_iter_init(env, ios);
-
-	npages = io->u.ci_rw.crw_count >> PAGE_SHIFT;
-	if (io->u.ci_rw.crw_pos & ~PAGE_MASK)
-		++npages;
-
-	oio->oi_lru_reserved = osc_lru_reserve(osc_cli(osc), npages);
-
-	return osc_io_iter_init(env, ios);
-}
-EXPORT_SYMBOL(osc_io_rw_iter_init);
-
 void osc_io_iter_fini(const struct lu_env *env,
 		      const struct cl_io_slice *ios)
 {
@@ -1177,16 +1161,40 @@ void osc_io_lseek_end(const struct lu_env *env,
 }
 EXPORT_SYMBOL(osc_io_lseek_end);
 
+int osc_io_lru_reserve(const struct lu_env *env,
+		       const struct cl_io_slice *ios,
+		       loff_t pos, size_t bytes)
+{
+	struct osc_object *osc = cl2osc(ios->cis_obj);
+	struct osc_io *oio = osc_env_io(env);
+	unsigned long npages = 0;
+	size_t page_offset;
+
+	page_offset = pos & ~PAGE_MASK;
+	if (page_offset) {
+		++npages;
+		if (bytes > PAGE_SIZE - page_offset)
+			bytes -= (PAGE_SIZE - page_offset);
+		else
+			bytes = 0;
+	}
+	npages += (bytes + PAGE_SIZE - 1) >> PAGE_SHIFT;
+	oio->oi_lru_reserved = osc_lru_reserve(osc_cli(osc), npages);
+
+	return 0;
+}
+EXPORT_SYMBOL(osc_io_lru_reserve);
+
 static const struct cl_io_operations osc_io_ops = {
 	.op = {
 		[CIT_READ] = {
-			.cio_iter_init	= osc_io_rw_iter_init,
+			.cio_iter_init	= osc_io_iter_init,
 			.cio_iter_fini	= osc_io_rw_iter_fini,
 			.cio_start	= osc_io_read_start,
 			.cio_fini	= osc_io_fini
 		},
 		[CIT_WRITE] = {
-			.cio_iter_init	= osc_io_rw_iter_init,
+			.cio_iter_init	= osc_io_iter_init,
 			.cio_iter_fini	= osc_io_rw_iter_fini,
 			.cio_start	= osc_io_write_start,
 			.cio_end	= osc_io_end,
@@ -1229,6 +1237,7 @@ void osc_io_lseek_end(const struct lu_env *env,
 		}
 	},
 	.cio_read_ahead			= osc_io_read_ahead,
+	.cio_lru_reserve		= osc_io_lru_reserve,
 	.cio_submit			= osc_io_submit,
 	.cio_commit_async		= osc_io_commit_async,
 	.cio_extent_release		= osc_io_extent_release
diff --git a/fs/lustre/osc/osc_page.c b/fs/lustre/osc/osc_page.c
index bb605af..c59a5ac 100644
--- a/fs/lustre/osc/osc_page.c
+++ b/fs/lustre/osc/osc_page.c
@@ -793,6 +793,13 @@ static int osc_lru_alloc(const struct lu_env *env, struct client_obd *cli,
 			break;
 		if (rc > 0)
 			continue;
+		/* IO issued by readahead, don't try hard */
+		if (oio->oi_is_readahead) {
+			if (atomic_long_read(cli->cl_lru_left) > 0)
+				continue;
+			rc = -EBUSY;
+			break;
+		}
 
 		cond_resched();
 
@@ -824,18 +831,23 @@ unsigned long osc_lru_reserve(struct client_obd *cli, unsigned long npages)
 	unsigned long reserved = 0;
 	unsigned long max_pages;
 	unsigned long c;
+	int rc;
 
-	/*
-	 * reserve a full RPC window at most to avoid that a thread accidentally
-	 * consumes too many LRU slots
-	 */
-	max_pages = cli->cl_max_pages_per_rpc * cli->cl_max_rpcs_in_flight;
-	if (npages > max_pages)
-		npages = max_pages;
-
+again:
 	c = atomic_long_read(cli->cl_lru_left);
 	if (c < npages && osc_lru_reclaim(cli, npages) > 0)
 		c = atomic_long_read(cli->cl_lru_left);
+
+	if (c < npages) {
+		/*
+		 * Trigger writeback in the hope some LRU slot could
+		 * be freed.
+		 */
+		rc = ptlrpcd_queue_work(cli->cl_writeback_work);
+		if (rc)
+			return 0;
+	}
+
 	while (c >= npages) {
 		if (c == atomic_long_cmpxchg(cli->cl_lru_left, c, c - npages)) {
 			reserved = npages;
@@ -843,6 +855,16 @@ unsigned long osc_lru_reserve(struct client_obd *cli, unsigned long npages)
 		}
 		c = atomic_long_read(cli->cl_lru_left);
 	}
+
+	if (reserved != npages) {
+		cond_resched();
+		rc = l_wait_event_abortable(
+			osc_lru_waitq,
+			atomic_long_read(cli->cl_lru_left) > 0);
+		goto again;
+	}
+
+	max_pages = cli->cl_max_pages_per_rpc * cli->cl_max_rpcs_in_flight;
 	if (atomic_long_read(cli->cl_lru_left) < max_pages) {
 		/*
 		 * If there aren't enough pages in the per-OSC LRU then
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 09/29] lustre: uapi: add mdt_hash_name
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (7 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 08/29] lustre: clio: fix hang on urgent cached pages James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 10/29] lustre: mdc: set fid2path RPC interruptible James Simmons
                   ` (19 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown
  Cc: Yang Sheng, Lustre Development List

From: Yang Sheng <ys@whamcloud.com>

Add mdt_hash_name to map LMV_HASH_NAME_* to a string. Will be
used to enhance debugging information.

WC-bug-id: https://jira.whamcloud.com/browse/LU-11776
Lustre-commit: 00141b1a746d4733 ("LU-11776 utils: add support lfs find with mdt hash flag")
Signed-off-by: Yang Sheng <ys@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/39340
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 include/uapi/linux/lustre/lustre_user.h | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/include/uapi/linux/lustre/lustre_user.h b/include/uapi/linux/lustre/lustre_user.h
index 7d4a9e9..acc0eaf 100644
--- a/include/uapi/linux/lustre/lustre_user.h
+++ b/include/uapi/linux/lustre/lustre_user.h
@@ -693,11 +693,14 @@ enum lmv_hash_type {
 	LMV_HASH_TYPE_MAX,
 };
 
-#define LMV_HASH_TYPE_DEFAULT LMV_HASH_TYPE_FNV_1A_64
+static __attribute__((unused)) const char *mdt_hash_name[] = {
+	"none",
+	"all_char",
+	"fnv_1a_64",
+	"crush",
+};
 
-#define LMV_HASH_NAME_ALL_CHARS	"all_char"
-#define LMV_HASH_NAME_FNV_1A_64	"fnv_1a_64"
-#define LMV_HASH_NAME_CRUSH	"crush"
+#define LMV_HASH_TYPE_DEFAULT LMV_HASH_TYPE_FNV_1A_64
 
 /* Right now only the lower part(0-16bits) of lmv_hash_type is being used,
  * and the higher part will be the flag to indicate the status of object,
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 10/29] lustre: mdc: set fid2path RPC interruptible
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (8 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 09/29] lustre: uapi: add mdt_hash_name James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 11/29] lustre: include: remove references to Sun Trademark James Simmons
                   ` (18 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lai Siyao, Lustre Development List

From: Lai Siyao <lai.siyao@whamcloud.com>

Sometimes OI scrub can't fix the inconsistency in FID and name, and
server will return -EINPROGRESS for fid2path request. Upon such
failure, client will keep resending the request. Set such request
to be interruptible to avoid deadlock.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14119
Lustre-commit: bf47526261067153 ("LU-14119 mdc: set fid2path RPC interruptible")
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/41219
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/include/lustre_net.h |  4 +++-
 fs/lustre/mdc/mdc_request.c    |  7 +++++++
 fs/lustre/ptlrpc/client.c      | 35 +++++++++++++++++++++++++++++++----
 3 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/fs/lustre/include/lustre_net.h b/fs/lustre/include/lustre_net.h
index 2b98468..abd16ea 100644
--- a/fs/lustre/include/lustre_net.h
+++ b/fs/lustre/include/lustre_net.h
@@ -445,6 +445,7 @@ struct ptlrpc_request_set {
 	set_producer_func	set_producer;
 	/** opaq argument passed to the producer callback */
 	void			*set_producer_arg;
+	unsigned int		set_allow_intr:1;
 };
 
 struct ptlrpc_bulk_desc;
@@ -825,7 +826,8 @@ struct ptlrpc_request {
 		rq_allow_replay:1,
 		/* bulk request, sent to server, but uncommitted */
 		rq_unstable:1,
-		rq_early_free_repbuf:1; /* free reply buffer in advance */
+		rq_early_free_repbuf:1, /* free reply buffer in advance */
+		rq_allow_intr:1;
 	/** @} */
 
 	/** server-side flags @{ */
diff --git a/fs/lustre/mdc/mdc_request.c b/fs/lustre/mdc/mdc_request.c
index ef27af6..6ac3a39 100644
--- a/fs/lustre/mdc/mdc_request.c
+++ b/fs/lustre/mdc/mdc_request.c
@@ -2293,6 +2293,13 @@ static int mdc_get_info_rpc(struct obd_export *exp,
 			     RCL_SERVER, vallen);
 	ptlrpc_request_set_replen(req);
 
+	/* if server failed to resolve FID, and OI scrub not able to fix it, it
+	 * will return -EINPROGRESS, ptlrpc_queue_wait() will keep retrying,
+	 * set request interruptible to avoid deadlock.
+	 */
+	if (KEY_IS(KEY_FID2PATH))
+		req->rq_allow_intr = 1;
+
 	rc = ptlrpc_queue_wait(req);
 	/* -EREMOTE means the get_info result is partial, and it needs to
 	 * continue on another MDT, see fid2path part in lmv_iocontrol
diff --git a/fs/lustre/ptlrpc/client.c b/fs/lustre/ptlrpc/client.c
index 04e8fec..3c57b69 100644
--- a/fs/lustre/ptlrpc/client.c
+++ b/fs/lustre/ptlrpc/client.c
@@ -1127,6 +1127,9 @@ void ptlrpc_set_add_req(struct ptlrpc_request_set *set,
 	LASSERT(req->rq_import->imp_state != LUSTRE_IMP_IDLE);
 	LASSERT(list_empty(&req->rq_set_chain));
 
+	if (req->rq_allow_intr)
+		set->set_allow_intr = 1;
+
 	/* The set takes over the caller's request reference */
 	list_add_tail(&req->rq_set_chain, &set->set_requests);
 	req->rq_set = set;
@@ -1725,6 +1728,7 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
 	list_for_each_entry_safe(req, next, &set->set_requests, rq_set_chain) {
 		struct obd_import *imp = req->rq_import;
 		int unregistered = 0;
+		int async = 1;
 		int rc = 0;
 
 		/*
@@ -1736,6 +1740,24 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
 		 */
 		cond_resched();
 
+		/*
+		 * If the caller requires to allow to be interpreted by force
+		 * and it has really been interpreted, then move the request
+		 * to RQ_PHASE_INTERPRET phase in spite of what the current
+		 * phase is.
+		 */
+		if (unlikely(req->rq_allow_intr && req->rq_intr)) {
+			req->rq_status = -EINTR;
+			ptlrpc_rqphase_move(req, RQ_PHASE_INTERPRET);
+
+			/*
+			 * Since it is interpreted and we have to wait for
+			 * the reply to be unlinked, then use sync mode.
+			 */
+			async = 0;
+			goto interpret;
+		}
+
 		if (req->rq_phase == RQ_PHASE_NEW &&
 		    ptlrpc_send_new_req(req)) {
 			force_timer_recalc = 1;
@@ -2067,13 +2089,13 @@ int ptlrpc_check_set(const struct lu_env *env, struct ptlrpc_request_set *set)
 		 * This moves to "unregistering" phase we need to wait for
 		 * reply unlink.
 		 */
-		if (!unregistered && !ptlrpc_unregister_reply(req, 1)) {
+		if (!unregistered && !ptlrpc_unregister_reply(req, async)) {
 			/* start async bulk unlink too */
 			ptlrpc_unregister_bulk(req, 1);
 			continue;
 		}
 
-		if (!ptlrpc_unregister_bulk(req, 1))
+		if (!ptlrpc_unregister_bulk(req, async))
 			continue;
 
 		/* When calling interpret receive should already be finished. */
@@ -2271,8 +2293,12 @@ static void ptlrpc_interrupted_set(struct ptlrpc_request_set *set)
 
 	CDEBUG(D_RPCTRACE, "INTERRUPTED SET %p\n", set);
 	list_for_each_entry(req, &set->set_requests, rq_set_chain) {
+		if (req->rq_intr)
+			continue;
+
 		if (req->rq_phase != RQ_PHASE_RPC &&
-		    req->rq_phase != RQ_PHASE_UNREG_RPC)
+		    req->rq_phase != RQ_PHASE_UNREG_RPC &&
+		    !req->rq_allow_intr)
 			continue;
 
 		spin_lock(&req->rq_lock);
@@ -2368,7 +2394,8 @@ int ptlrpc_set_wait(const struct lu_env *env, struct ptlrpc_request_set *set)
 		CDEBUG(D_RPCTRACE, "set %p going to sleep for %lld seconds\n",
 		       set, timeout);
 
-		if (timeout == 0 && !signal_pending(current)) {
+		if ((timeout == 0 && !signal_pending(current)) ||
+		    set->set_allow_intr) {
 			/*
 			 * No requests are in-flight (ether timed out
 			 * or delayed), so we can allow interrupts.
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 11/29] lustre: include: remove references to Sun Trademark.
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (9 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 10/29] lustre: mdc: set fid2path RPC interruptible James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 12/29] lnet: o2iblnd: Use REMOTE_DROPPED for ECONNREFUSED James Simmons
                   ` (17 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Mr NeilBrown <neilb@suse.de>

"lustre" is no longer a Trademark of Sun Microsystems.  There is no
need to acknowledge the trademark is every file, so just remove all
these claims.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14487
Lustre-commit: 1d3c585194a907ad ("LU-14487 lustre: remove references to Sun Trademark.")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/41880
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/include/cl_object.h             | 1 -
 fs/lustre/include/lprocfs_status.h        | 1 -
 fs/lustre/include/lu_object.h             | 1 -
 fs/lustre/include/lustre_acl.h            | 1 -
 fs/lustre/include/lustre_disk.h           | 1 -
 fs/lustre/include/lustre_dlm.h            | 1 -
 fs/lustre/include/lustre_export.h         | 1 -
 fs/lustre/include/lustre_fid.h            | 1 -
 fs/lustre/include/lustre_fld.h            | 1 -
 fs/lustre/include/lustre_ha.h             | 1 -
 fs/lustre/include/lustre_handles.h        | 2 --
 fs/lustre/include/lustre_import.h         | 2 --
 fs/lustre/include/lustre_intent.h         | 1 -
 fs/lustre/include/lustre_lib.h            | 1 -
 fs/lustre/include/lustre_log.h            | 1 -
 fs/lustre/include/lustre_mdc.h            | 1 -
 fs/lustre/include/lustre_net.h            | 1 -
 fs/lustre/include/lustre_osc.h            | 1 -
 fs/lustre/include/lustre_req_layout.h     | 1 -
 fs/lustre/include/lustre_sec.h            | 1 -
 fs/lustre/include/obd.h                   | 1 -
 fs/lustre/include/obd_cksum.h             | 1 -
 fs/lustre/include/obd_class.h             | 1 -
 fs/lustre/include/obd_support.h           | 1 -
 fs/lustre/include/obd_target.h            | 1 -
 include/uapi/linux/lustre/lustre_cfg.h    | 1 -
 include/uapi/linux/lustre/lustre_fiemap.h | 1 -
 include/uapi/linux/lustre/lustre_idl.h    | 1 -
 include/uapi/linux/lustre/lustre_param.h  | 1 -
 include/uapi/linux/lustre/lustre_user.h   | 1 -
 30 files changed, 32 deletions(-)

diff --git a/fs/lustre/include/cl_object.h b/fs/lustre/include/cl_object.h
index 6554e3d..3926aac 100644
--- a/fs/lustre/include/cl_object.h
+++ b/fs/lustre/include/cl_object.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 #ifndef _LUSTRE_CL_OBJECT_H
 #define _LUSTRE_CL_OBJECT_H
diff --git a/fs/lustre/include/lprocfs_status.h b/fs/lustre/include/lprocfs_status.h
index 9051de7..c8923c8 100644
--- a/fs/lustre/include/lprocfs_status.h
+++ b/fs/lustre/include/lprocfs_status.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/include/lprocfs_status.h
  *
diff --git a/fs/lustre/include/lu_object.h b/fs/lustre/include/lu_object.h
index 34610d4..80cd36d 100644
--- a/fs/lustre/include/lu_object.h
+++ b/fs/lustre/include/lu_object.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef __LUSTRE_LU_OBJECT_H
diff --git a/fs/lustre/include/lustre_acl.h b/fs/lustre/include/lustre_acl.h
index bb161ba..43b6f1d 100644
--- a/fs/lustre/include/lustre_acl.h
+++ b/fs/lustre/include/lustre_acl.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/include/lustre_acl.h
  */
diff --git a/fs/lustre/include/lustre_disk.h b/fs/lustre/include/lustre_disk.h
index a54b5fd..81a0d40 100644
--- a/fs/lustre/include/lustre_disk.h
+++ b/fs/lustre/include/lustre_disk.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/include/lustre_disk.h
  *
diff --git a/fs/lustre/include/lustre_dlm.h b/fs/lustre/include/lustre_dlm.h
index 8156f75..f1828df 100644
--- a/fs/lustre/include/lustre_dlm.h
+++ b/fs/lustre/include/lustre_dlm.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 /** \defgroup LDLM Lustre Distributed Lock Manager
diff --git a/fs/lustre/include/lustre_export.h b/fs/lustre/include/lustre_export.h
index 4cc88ef..6a59e6c 100644
--- a/fs/lustre/include/lustre_export.h
+++ b/fs/lustre/include/lustre_export.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 /** \defgroup obd_export PortalRPC export definitions
  *
diff --git a/fs/lustre/include/lustre_fid.h b/fs/lustre/include/lustre_fid.h
index c67dfb2d..b8a3f2e 100644
--- a/fs/lustre/include/lustre_fid.h
+++ b/fs/lustre/include/lustre_fid.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/include/lustre_fid.h
  *
diff --git a/fs/lustre/include/lustre_fld.h b/fs/lustre/include/lustre_fld.h
index 92074ab..2382484 100644
--- a/fs/lustre/include/lustre_fld.h
+++ b/fs/lustre/include/lustre_fld.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef __LINUX_FLD_H
diff --git a/fs/lustre/include/lustre_ha.h b/fs/lustre/include/lustre_ha.h
index c914ef6..a072b95 100644
--- a/fs/lustre/include/lustre_ha.h
+++ b/fs/lustre/include/lustre_ha.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef _LUSTRE_HA_H
diff --git a/fs/lustre/include/lustre_handles.h b/fs/lustre/include/lustre_handles.h
index 9dbe7c9..88111ae 100644
--- a/fs/lustre/include/lustre_handles.h
+++ b/fs/lustre/include/lustre_handles.h
@@ -1,4 +1,3 @@
-// SPDX-License-Identifier: GPL-2.0
 /*
  * GPL HEADER START
  *
@@ -28,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef __LUSTRE_HANDLES_H_
diff --git a/fs/lustre/include/lustre_import.h b/fs/lustre/include/lustre_import.h
index 72a303e..8c1fe65 100644
--- a/fs/lustre/include/lustre_import.h
+++ b/fs/lustre/include/lustre_import.h
@@ -1,4 +1,3 @@
-// SPDX-License-Identifier: GPL-2.0
 /*
  * GPL HEADER START
  *
@@ -28,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 /** \defgroup obd_import PtlRPC import definitions
  * Imports are client-side representation of remote obd target.
diff --git a/fs/lustre/include/lustre_intent.h b/fs/lustre/include/lustre_intent.h
index f97c318..e7d81f6 100644
--- a/fs/lustre/include/lustre_intent.h
+++ b/fs/lustre/include/lustre_intent.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef LUSTRE_INTENT_H
diff --git a/fs/lustre/include/lustre_lib.h b/fs/lustre/include/lustre_lib.h
index fc4b4c5..7210a56 100644
--- a/fs/lustre/include/lustre_lib.h
+++ b/fs/lustre/include/lustre_lib.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/include/lustre_lib.h
  *
diff --git a/fs/lustre/include/lustre_log.h b/fs/lustre/include/lustre_log.h
index 24e6609..1fc7729 100644
--- a/fs/lustre/include/lustre_log.h
+++ b/fs/lustre/include/lustre_log.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/include/lustre_log.h
  *
diff --git a/fs/lustre/include/lustre_mdc.h b/fs/lustre/include/lustre_mdc.h
index d7b6e4a..2ee77ce 100644
--- a/fs/lustre/include/lustre_mdc.h
+++ b/fs/lustre/include/lustre_mdc.h
@@ -29,7 +29,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/include/lustre_mdc.h
  *
diff --git a/fs/lustre/include/lustre_net.h b/fs/lustre/include/lustre_net.h
index abd16ea..e1eb888 100644
--- a/fs/lustre/include/lustre_net.h
+++ b/fs/lustre/include/lustre_net.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 /** \defgroup PtlRPC Portal RPC and networking module.
  *
diff --git a/fs/lustre/include/lustre_osc.h b/fs/lustre/include/lustre_osc.h
index 17bfbfb..f83d1e6 100644
--- a/fs/lustre/include/lustre_osc.h
+++ b/fs/lustre/include/lustre_osc.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 /*
  * fs/lustre/include/lustre_osc.h
diff --git a/fs/lustre/include/lustre_req_layout.h b/fs/lustre/include/lustre_req_layout.h
index 434bb08..f6ebda3 100644
--- a/fs/lustre/include/lustre_req_layout.h
+++ b/fs/lustre/include/lustre_req_layout.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/include/lustre_req_layout.h
  *
diff --git a/fs/lustre/include/lustre_sec.h b/fs/lustre/include/lustre_sec.h
index aec30bc..e8410e1 100644
--- a/fs/lustre/include/lustre_sec.h
+++ b/fs/lustre/include/lustre_sec.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef _LUSTRE_SEC_H_
diff --git a/fs/lustre/include/obd.h b/fs/lustre/include/obd.h
index 9957105..efd4538 100644
--- a/fs/lustre/include/obd.h
+++ b/fs/lustre/include/obd.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef __OBD_H
diff --git a/fs/lustre/include/obd_cksum.h b/fs/lustre/include/obd_cksum.h
index 08c1cb9..1189bc2 100644
--- a/fs/lustre/include/obd_cksum.h
+++ b/fs/lustre/include/obd_cksum.h
@@ -26,7 +26,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef __OBD_CKSUM
diff --git a/fs/lustre/include/obd_class.h b/fs/lustre/include/obd_class.h
index 6bcd89b..1d1777a 100644
--- a/fs/lustre/include/obd_class.h
+++ b/fs/lustre/include/obd_class.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 #ifndef __CLASS_OBD_H
 #define __CLASS_OBD_H
diff --git a/fs/lustre/include/obd_support.h b/fs/lustre/include/obd_support.h
index 027667f..878a5cd 100644
--- a/fs/lustre/include/obd_support.h
+++ b/fs/lustre/include/obd_support.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef _OBD_SUPPORT
diff --git a/fs/lustre/include/obd_target.h b/fs/lustre/include/obd_target.h
index 466dd3c..5d8e8bb 100644
--- a/fs/lustre/include/obd_target.h
+++ b/fs/lustre/include/obd_target.h
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef __OBD_TARGET_H
diff --git a/include/uapi/linux/lustre/lustre_cfg.h b/include/uapi/linux/lustre/lustre_cfg.h
index 1036d0d..2a1eabb 100644
--- a/include/uapi/linux/lustre/lustre_cfg.h
+++ b/include/uapi/linux/lustre/lustre_cfg.h
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef _UAPI_LUSTRE_CFG_H_
diff --git a/include/uapi/linux/lustre/lustre_fiemap.h b/include/uapi/linux/lustre/lustre_fiemap.h
index f93e107..c3e32ef 100644
--- a/include/uapi/linux/lustre/lustre_fiemap.h
+++ b/include/uapi/linux/lustre/lustre_fiemap.h
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * FIEMAP data structures and flags. This header file will be used until
  * fiemap.h is available in the upstream kernel.
diff --git a/include/uapi/linux/lustre/lustre_idl.h b/include/uapi/linux/lustre/lustre_idl.h
index b0c6191..d71fe47 100644
--- a/include/uapi/linux/lustre/lustre_idl.h
+++ b/include/uapi/linux/lustre/lustre_idl.h
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Lustre wire protocol definitions.
  */
diff --git a/include/uapi/linux/lustre/lustre_param.h b/include/uapi/linux/lustre/lustre_param.h
index ab026e3..fda6e7a 100644
--- a/include/uapi/linux/lustre/lustre_param.h
+++ b/include/uapi/linux/lustre/lustre_param.h
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * User-settable parameter keys
  *
diff --git a/include/uapi/linux/lustre/lustre_user.h b/include/uapi/linux/lustre/lustre_user.h
index acc0eaf..3e2144a 100644
--- a/include/uapi/linux/lustre/lustre_user.h
+++ b/include/uapi/linux/lustre/lustre_user.h
@@ -27,7 +27,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/include/lustre/lustre_user.h
  *
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 12/29] lnet: o2iblnd: Use REMOTE_DROPPED for ECONNREFUSED
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (10 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 11/29] lustre: include: remove references to Sun Trademark James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 13/29] lustre: lmv: reduce struct lmv_obd size James Simmons
                   ` (16 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown
  Cc: Chris Horn, Lustre Development List

From: Chris Horn <chris.horn@hpe.com>

ECONNREFUSED means that we received a response from the remote end,
so setting the LNet health status to REMOTE_DROPPED is more
appropriate than setting LOCAL_DROPPED. Using REMOTE_DROPPED will
decrement the peer NI health and allow us to try other peer NIs for
future sends.

Decrementing the peer NI health will also result in routes being
marked down, as appropriate, for cases where a router has refused the
connection request.

HPE-bug-id: LUS-9853
WC-bug-id: https://jira.whamcloud.com/browse/LU-14540
Lustre-commit: f9d837b479232bfc ("LU-14540 o2iblnd: Use REMOTE_DROPPED for ECONNREFUSED")
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Reviewed-on: https://review.whamcloud.com/42114
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
index 5066c93..6445f0a 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -2105,6 +2105,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 {
 	LIST_HEAD(zombies);
 	unsigned long flags;
+	enum lnet_msg_hstatus hstatus;
 
 	LASSERT(error);
 	LASSERT(!in_interrupt());
@@ -2150,12 +2151,20 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 	CNETERR("Deleting messages for %s: connection failed\n",
 		libcfs_nid2str(peer_ni->ibp_nid));
 
-	if (error == -EHOSTUNREACH || error == -ETIMEDOUT)
-		kiblnd_txlist_done(&zombies, error,
-				   LNET_MSG_STATUS_NETWORK_TIMEOUT);
-	else
-		kiblnd_txlist_done(&zombies, error,
-				   LNET_MSG_STATUS_LOCAL_DROPPED);
+	switch (error) {
+	case -EHOSTUNREACH:
+	case -ETIMEDOUT:
+		hstatus = LNET_MSG_STATUS_NETWORK_TIMEOUT;
+		break;
+	case -ECONNREFUSED:
+		hstatus = LNET_MSG_STATUS_REMOTE_DROPPED;
+		break;
+	default:
+		hstatus = LNET_MSG_STATUS_LOCAL_DROPPED;
+		break;
+	}
+
+	kiblnd_txlist_done(&zombies, error, hstatus);
 }
 
 static void
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 13/29] lustre: lmv: reduce struct lmv_obd size
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (11 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 12/29] lnet: o2iblnd: Use REMOTE_DROPPED for ECONNREFUSED James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 14/29] lustre: uapi: remove obsolete ioctls James Simmons
                   ` (15 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Andreas Dilger <adilger@whamcloud.com>

The lmv_obd struct contains lmv_mdt_descs which is large enough
to reference 512 * 512 = 262144 targets, but there can be only
65536 OSTs or MDTs in a single filesystem today.

Shrink the allocation size to match the current limits, reducing
the size of obd_device.u since this is the largest union member.

This reduces the size of each obd_device from 6752 to 4568 bytes.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14055
Lustre-commit: e11deeb1e6d11460 ("LU-14055 lmv: reduce struct lmv_obd size")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/41162
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/include/lu_object.h     | 8 ++++----
 fs/lustre/obdclass/lu_tgt_descs.c | 5 ++++-
 2 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/fs/lustre/include/lu_object.h b/fs/lustre/include/lu_object.h
index 80cd36d..75bb6c3 100644
--- a/fs/lustre/include/lu_object.h
+++ b/fs/lustre/include/lu_object.h
@@ -1473,10 +1473,10 @@ struct lu_tgt_desc {
 			ltd_connecting:1;  /* target is connecting */
 };
 
-/* number of pointers at 1st level */
-#define TGT_PTRS		(PAGE_SIZE / sizeof(void *))
 /* number of pointers at 2nd level */
 #define TGT_PTRS_PER_BLOCK	(PAGE_SIZE / sizeof(void *))
+/* number of pointers at 1st level - only need as many as max OST/MDT count */
+#define TGT_PTRS		((LOV_ALL_STRIPES + 1) / TGT_PTRS_PER_BLOCK)
 
 struct lu_tgt_desc_idx {
 	struct lu_tgt_desc *ldi_tgt[TGT_PTRS_PER_BLOCK];
@@ -1521,8 +1521,8 @@ struct lu_tgt_descs {
 };
 
 #define LTD_TGT(ltd, index)						\
-	 (ltd)->ltd_tgt_idx[(index) / TGT_PTRS_PER_BLOCK]		\
-			->ldi_tgt[(index) % TGT_PTRS_PER_BLOCK]
+	 (ltd)->ltd_tgt_idx[(index) / TGT_PTRS_PER_BLOCK]->		\
+		ldi_tgt[(index) % TGT_PTRS_PER_BLOCK]
 
 u64 lu_prandom_u64_max(u64 ep_ro);
 void lu_qos_rr_init(struct lu_qos_rr *lqr);
diff --git a/fs/lustre/obdclass/lu_tgt_descs.c b/fs/lustre/obdclass/lu_tgt_descs.c
index a77ce20..ef30ee3 100644
--- a/fs/lustre/obdclass/lu_tgt_descs.c
+++ b/fs/lustre/obdclass/lu_tgt_descs.c
@@ -298,7 +298,7 @@ void lu_tgt_descs_fini(struct lu_tgt_descs *ltd)
 	int i;
 
 	bitmap_free(ltd->ltd_tgt_bitmap);
-	for (i = 0; i < TGT_PTRS; i++)
+	for (i = 0; i < ARRAY_SIZE(ltd->ltd_tgt_idx); i++)
 		kfree(ltd->ltd_tgt_idx[i]);
 	ltd->ltd_tgts_size = 0;
 }
@@ -368,6 +368,9 @@ int ltd_add_tgt(struct lu_tgt_descs *ltd, struct lu_tgt_desc *tgt)
 	if (index >= ltd->ltd_tgts_size) {
 		u32 newsize = 1;
 
+		if (index > TGT_PTRS * TGT_PTRS_PER_BLOCK)
+			return -ENFILE;
+
 		while (newsize < index + 1)
 			newsize = newsize << 1;
 
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 14/29] lustre: uapi: remove obsolete ioctls
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (12 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 13/29] lustre: lmv: reduce struct lmv_obd size James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 15/29] lustre: lmv: don't include struct lu_qos_rr in client James Simmons
                   ` (14 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Andreas Dilger <adilger@whamcloud.com>

Remove some very obsolete ioctl number definitions.

Highlight that some of the ioctl codes conflict with upstream
FSVerity ioctls that we may need to implement in the future.
This does not necessarily mean the actual ioctl numbers will
conflict (the "size" field can disambiguate them), but we should
avoid this range when adding new ioctls.

WC-bug-id: https://jira.whamcloud.com/browse/LU-13107
Lustre-commit: 0f38a0b9db4f7c6c1 ("LU-13107 uapi: remove obsolete ioctls")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/37107
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/llite/dir.c                    |  3 +++
 fs/lustre/llite/file.c                   |  3 +++
 fs/lustre/llite/llite_lib.c              |  2 +-
 include/uapi/linux/lustre/lustre_ioctl.h | 28 +++++++++-------------------
 include/uapi/linux/lustre/lustre_user.h  |  1 +
 5 files changed, 17 insertions(+), 20 deletions(-)

diff --git a/fs/lustre/llite/dir.c b/fs/lustre/llite/dir.c
index 5dc93f4..76294ff5 100644
--- a/fs/lustre/llite/dir.c
+++ b/fs/lustre/llite/dir.c
@@ -1865,7 +1865,10 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		kfree(qctl);
 		return rc;
 	}
+	case OBD_IOC_GETNAME_OLD:
+		/* fall through */
 	case OBD_IOC_GETDTNAME:
+		/* fall through */
 	case OBD_IOC_GETMDNAME:
 		return ll_get_obd_name(inode, cmd, arg);
 	case LL_IOC_FLUSHCTX:
diff --git a/fs/lustre/llite/file.c b/fs/lustre/llite/file.c
index e9f0fc9..1ca4589 100644
--- a/fs/lustre/llite/file.c
+++ b/fs/lustre/llite/file.c
@@ -3745,7 +3745,10 @@ static int ll_heat_set(struct inode *inode, enum lu_heat_flag flags)
 
 		return 0;
 	}
+	case OBD_IOC_GETNAME_OLD:
+		/* fall through */
 	case OBD_IOC_GETDTNAME:
+		/* fall through */
 	case OBD_IOC_GETMDNAME:
 		return ll_get_obd_name(inode, cmd, arg);
 	case LL_IOC_HSM_STATE_GET: {
diff --git a/fs/lustre/llite/llite_lib.c b/fs/lustre/llite/llite_lib.c
index 2f2d9f0..6af95fd 100644
--- a/fs/lustre/llite/llite_lib.c
+++ b/fs/lustre/llite/llite_lib.c
@@ -2986,7 +2986,7 @@ int ll_get_obd_name(struct inode *inode, unsigned int cmd, unsigned long arg)
 	struct ll_sb_info *sbi = ll_i2sbi(inode);
 	struct obd_device *obd;
 
-	if (cmd == OBD_IOC_GETDTNAME)
+	if (cmd == OBD_IOC_GETNAME_OLD || cmd == OBD_IOC_GETDTNAME)
 		obd = class_exp2obd(sbi->ll_dt_exp);
 	else if (cmd == OBD_IOC_GETMDNAME)
 		obd = class_exp2obd(sbi->ll_md_exp);
diff --git a/include/uapi/linux/lustre/lustre_ioctl.h b/include/uapi/linux/lustre/lustre_ioctl.h
index be388fc..fb1e6f1 100644
--- a/include/uapi/linux/lustre/lustre_ioctl.h
+++ b/include/uapi/linux/lustre/lustre_ioctl.h
@@ -132,11 +132,6 @@ static inline __u32 obd_ioctl_packlen(struct obd_ioctl_data *data)
  */
 #define OBD_IOC_DATA_TYPE	long
 
-/*	IOC_LDLM_TEST		_IOWR('f', 40, long) */
-/*	IOC_LDLM_DUMP		_IOWR('f', 41, long) */
-/*	IOC_LDLM_REGRESS_START	_IOWR('f', 42, long) */
-/*	IOC_LDLM_REGRESS_STOP	_IOWR('f', 43, long) */
-
 #define OBD_IOC_CREATE		_IOWR('f', 101, OBD_IOC_DATA_TYPE)
 #define OBD_IOC_DESTROY		_IOW('f', 104, OBD_IOC_DATA_TYPE)
 /*	OBD_IOC_PREALLOCATE	_IOWR('f', 105, OBD_IOC_DATA_TYPE) */
@@ -148,29 +143,24 @@ static inline __u32 obd_ioctl_packlen(struct obd_ioctl_data *data)
 
 #define OBD_IOC_STATFS		_IOWR('f', 113, OBD_IOC_DATA_TYPE)
 #define OBD_IOC_SYNC		_IOW('f', 114, OBD_IOC_DATA_TYPE)
-/*	OBD_IOC_READ2		_IOWR('f', 115, OBD_IOC_DATA_TYPE) */
-/*	OBD_IOC_FORMAT		_IOWR('f', 116, OBD_IOC_DATA_TYPE) */
-/*	OBD_IOC_PARTITION	_IOWR('f', 117, OBD_IOC_DATA_TYPE) */
-/*	OBD_IOC_COPY		_IOWR('f', 120, OBD_IOC_DATA_TYPE) */
-/*	OBD_IOC_MIGR		_IOWR('f', 121, OBD_IOC_DATA_TYPE) */
-/*	OBD_IOC_PUNCH		_IOWR('f', 122, OBD_IOC_DATA_TYPE) */
-
-/*	OBD_IOC_MODULE_DEBUG	_IOWR('f', 124, OBD_IOC_DATA_TYPE) */
+
 #define OBD_IOC_BRW_READ	_IOWR('f', 125, OBD_IOC_DATA_TYPE)
 #define OBD_IOC_BRW_WRITE	_IOWR('f', 126, OBD_IOC_DATA_TYPE)
 #define OBD_IOC_NAME2DEV	_IOWR('f', 127, OBD_IOC_DATA_TYPE)
+#define OBD_IOC_GETDTNAME	_IOR('f', 127, char[MAX_OBD_NAME])
+/* ioctl codes 128-143 are reserved for fsverity */
 #define OBD_IOC_UUID2DEV	_IOWR('f', 130, OBD_IOC_DATA_TYPE)
-#define OBD_IOC_GETNAME		_IOWR('f', 131, OBD_IOC_DATA_TYPE)
+#define OBD_IOC_GETNAME_OLD	_IOWR('f', 131, OBD_IOC_DATA_TYPE)
 #define OBD_IOC_GETMDNAME	_IOR('f', 131, char[MAX_OBD_NAME])
-#define OBD_IOC_GETDTNAME	OBD_IOC_GETNAME
 /*	OBD_IOC_LOV_GET_CONFIG	_IOWR('f', 132, OBD_IOC_DATA_TYPE) until 2.14 */
 #define OBD_IOC_CLIENT_RECOVER	_IOW('f', 133, OBD_IOC_DATA_TYPE)
-/* was	OBD_IOC_PING_TARGET	_IOW('f', 136, OBD_IOC_DATA_TYPE) until 2.11 */
-/*	OBD_IOC_DEC_FS_USE_COUNT _IO('f', 139) */
-/* was OBD_IOC_NO_TRANSNO      _IOW('f', 140, OBD_IOC_DATA_TYPE) until 2.14 */
+/* ioctl codes 128-143 are reserved for fsverity */
+/* FS_IOC_ENABLE_VERITY		_IOW('f', 133, struct fsverity_enable_arg) */
+/* FS_IOC_MEASURE_VERITY	_IOW('f', 134, struct fsverity_digest) */
+/* was OBD_IOC_NO_TRANSNO	_IOW('f', 140, OBD_IOC_DATA_TYPE) until 2.14 */
 #define OBD_IOC_SET_READONLY	_IOW('f', 141, OBD_IOC_DATA_TYPE)
 #define OBD_IOC_ABORT_RECOVERY	_IOR('f', 142, OBD_IOC_DATA_TYPE)
-/*	OBD_IOC_ROOT_SQUASH	_IOWR('f', 143, OBD_IOC_DATA_TYPE) */
+/* ioctl codes 128-143 are reserved for fsverity */
 #define OBD_GET_VERSION		_IOWR('f', 144, OBD_IOC_DATA_TYPE)
 /*	OBD_IOC_GSS_SUPPORT	_IOWR('f', 145, OBD_IOC_DATA_TYPE) */
 /*	OBD_IOC_CLOSE_UUID	_IOWR('f', 147, OBD_IOC_DATA_TYPE) */
diff --git a/include/uapi/linux/lustre/lustre_user.h b/include/uapi/linux/lustre/lustre_user.h
index 3e2144a..4a21cd6 100644
--- a/include/uapi/linux/lustre/lustre_user.h
+++ b/include/uapi/linux/lustre/lustre_user.h
@@ -312,6 +312,7 @@ struct ll_ioc_lease_id {
  * *INFO    - set/get lov_user_mds_data
  */
 /*	lustre_ioctl.h			101-150 */
+/* ioctl codes 128-143 are reserved for fsverity */
 #define LL_IOC_GETFLAGS			_IOR('f', 151, long)
 #define LL_IOC_SETFLAGS			_IOW('f', 152, long)
 #define LL_IOC_CLRFLAGS			_IOW('f', 153, long)
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 15/29] lustre: lmv: don't include struct lu_qos_rr in client
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (13 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 14/29] lustre: uapi: remove obsolete ioctls James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 16/29] lnet: libcfs: fix setting of debug_path James Simmons
                   ` (13 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Mr NeilBrown <neilb@suse.de>

The 'lqrr' field in 'struct lu_qos' is not used on the client (lmv).
So make it server-only for use in lod. We can safely remove it from
the Linux client.

WC-bug-id: https://jira.whamcloud.com/browse/LU-8837
Lustre-commit: b6882c8ae4f47e93 ("LU-8837 lmv: don't include struct lu_qos_rr in client")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/41950
Reviewed-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/include/lu_object.h     | 22 +++++-----------------
 fs/lustre/obdclass/lu_tgt_descs.c | 11 -----------
 2 files changed, 5 insertions(+), 28 deletions(-)

diff --git a/fs/lustre/include/lu_object.h b/fs/lustre/include/lu_object.h
index 75bb6c3..0aa28c7 100644
--- a/fs/lustre/include/lu_object.h
+++ b/fs/lustre/include/lu_object.h
@@ -1413,16 +1413,6 @@ enum lq_flag {
 	LQ_RESET,		/* zero current penalties */
 };
 
-/* round-robin QoS data for LOD/LMV */
-struct lu_qos_rr {
-	spinlock_t		 lqr_alloc;	/* protect allocation index */
-	u32			 lqr_start_idx;	/* start index of new inode */
-	u32			 lqr_offset_idx;/* aliasing for start_idx */
-	int			 lqr_start_count;/* reseed counter */
-	struct lu_tgt_pool	 lqr_pool;	/* round-robin optimized list */
-	unsigned long		 lqr_flags;
-};
-
 /* QoS data per MDS/OSS */
 struct lu_svr_qos {
 	struct obd_uuid		 lsq_uuid;	/* ptlrpc's c_remote_uuid */
@@ -1484,12 +1474,11 @@ struct lu_tgt_desc_idx {
 
 /* QoS data for LOD/LMV */
 struct lu_qos {
-	struct list_head	 lq_svr_list;	 /* lu_svr_qos list */
-	struct rw_semaphore	 lq_rw_sem;
-	u32			 lq_active_svr_count;
-	unsigned int		 lq_prio_free;	 /* priority for free space */
-	unsigned int		 lq_threshold_rr;/* priority for rr */
-	struct lu_qos_rr	 lq_rr;		 /* round robin qos data */
+	struct list_head	lq_svr_list;	 /* lu_svr_qos list */
+	struct rw_semaphore	lq_rw_sem;
+	u32			lq_active_svr_count;
+	unsigned int		lq_prio_free;	 /* priority for free space */
+	unsigned int		lq_threshold_rr;/* priority for rr */
 	unsigned long		lq_flags;
 };
 
@@ -1525,7 +1514,6 @@ struct lu_tgt_descs {
 		ldi_tgt[(index) % TGT_PTRS_PER_BLOCK]
 
 u64 lu_prandom_u64_max(u64 ep_ro);
-void lu_qos_rr_init(struct lu_qos_rr *lqr);
 int lu_qos_add_tgt(struct lu_qos *qos, struct lu_tgt_desc *ltd);
 void lu_tgt_qos_weight_calc(struct lu_tgt_desc *tgt);
 
diff --git a/fs/lustre/obdclass/lu_tgt_descs.c b/fs/lustre/obdclass/lu_tgt_descs.c
index ef30ee3..cb62ce4 100644
--- a/fs/lustre/obdclass/lu_tgt_descs.c
+++ b/fs/lustre/obdclass/lu_tgt_descs.c
@@ -77,13 +77,6 @@ u64 lu_prandom_u64_max(u64 ep_ro)
 }
 EXPORT_SYMBOL(lu_prandom_u64_max);
 
-void lu_qos_rr_init(struct lu_qos_rr *lqr)
-{
-	spin_lock_init(&lqr->lqr_alloc);
-	set_bit(LQ_DIRTY, &lqr->lqr_flags);
-}
-EXPORT_SYMBOL(lu_qos_rr_init);
-
 /**
  * Add a new target to Quality of Service (QoS) target table.
  *
@@ -159,7 +152,6 @@ int lu_qos_add_tgt(struct lu_qos *qos, struct lu_tgt_desc *tgt)
 	list_add_tail(&svr->lsq_svr_list, &tempsvr->lsq_svr_list);
 
 	set_bit(LQ_DIRTY, &qos->lq_flags);
-	set_bit(LQ_DIRTY, &qos->lq_rr.lqr_flags);
 out:
 	up_write(&qos->lq_rw_sem);
 	return rc;
@@ -200,7 +192,6 @@ static int lu_qos_del_tgt(struct lu_qos *qos, struct lu_tgt_desc *ltd)
 	}
 
 	set_bit(LQ_DIRTY, &qos->lq_flags);
-	set_bit(LQ_DIRTY, &qos->lq_rr.lqr_flags);
 out:
 	up_write(&qos->lq_rw_sem);
 	return rc;
@@ -282,8 +273,6 @@ int lu_tgt_descs_init(struct lu_tgt_descs *ltd, bool is_mdt)
 	if (is_mdt)
 		ltd->ltd_lmv_desc.ld_pattern = LMV_HASH_TYPE_DEFAULT;
 
-	lu_qos_rr_init(&ltd->ltd_qos.lq_rr);
-
 	return 0;
 }
 EXPORT_SYMBOL(lu_tgt_descs_init);
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 16/29] lnet: libcfs: fix setting of debug_path
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (14 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 15/29] lustre: lmv: don't include struct lu_qos_rr in client James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 17/29] lnet: Use lr_hops for avoid_asym_router_failure James Simmons
                   ` (12 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Andreas Dilger <adilger@whamcloud.com>

While it was possible to set "lctl set_param debug_path=path" or
"echo path > /sys/module/libcfs/parameters/libcfs_debug_file_path"
this change does not affect the path used to dump debug logs.

Connect these parameters to the pathname used for the debug log.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14550
Lustre-commit: f7392c7c4a16bc11 ("LU-14550 libcfs: fix setting of debug_path")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/43109
Reviewed-by: Jian Yu <yujian@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/osc/osc_request.c         |  5 ++---
 include/linux/libcfs/libcfs_debug.h |  2 +-
 net/lnet/libcfs/debug.c             | 18 +++++-------------
 3 files changed, 8 insertions(+), 17 deletions(-)

diff --git a/fs/lustre/osc/osc_request.c b/fs/lustre/osc/osc_request.c
index 8046e33..1bd0d2c 100644
--- a/fs/lustre/osc/osc_request.c
+++ b/fs/lustre/osc/osc_request.c
@@ -1804,9 +1804,8 @@ static void dump_all_bulk_pages(struct obdo *oa, u32 page_count,
 	 */
 	snprintf(dbgcksum_file_name, sizeof(dbgcksum_file_name),
 		 "%s-checksum_dump-osc-" DFID ":[%llu-%llu]-%x-%x",
-		 (strncmp(libcfs_debug_file_path_arr, "NONE", 4) != 0 ?
-		  libcfs_debug_file_path_arr :
-		  LIBCFS_DEBUG_FILE_PATH_DEFAULT),
+		 (strncmp(libcfs_debug_file_path, "NONE", 4) != 0 ?
+		  libcfs_debug_file_path : LIBCFS_DEBUG_FILE_PATH_DEFAULT),
 		 oa->o_valid & OBD_MD_FLFID ? oa->o_parent_seq : 0ULL,
 		 oa->o_valid & OBD_MD_FLFID ? oa->o_parent_oid : 0,
 		 oa->o_valid & OBD_MD_FLFID ? oa->o_parent_ver : 0,
diff --git a/include/linux/libcfs/libcfs_debug.h b/include/linux/libcfs/libcfs_debug.h
index 93eb752..bc85bb9 100644
--- a/include/linux/libcfs/libcfs_debug.h
+++ b/include/linux/libcfs/libcfs_debug.h
@@ -55,7 +55,7 @@
 extern unsigned int libcfs_console_min_delay;
 extern unsigned int libcfs_console_backoff;
 extern unsigned int libcfs_debug_binary;
-extern char libcfs_debug_file_path_arr[PATH_MAX];
+extern char *libcfs_debug_file_path;
 
 struct task_struct;
 
diff --git a/net/lnet/libcfs/debug.c b/net/lnet/libcfs/debug.c
index e519fdb..cb6c33a 100644
--- a/net/lnet/libcfs/debug.c
+++ b/net/lnet/libcfs/debug.c
@@ -225,11 +225,9 @@ static int param_set_uintpos(const char *val, const struct kernel_param *kp)
 
 static DECLARE_COMPLETION(debug_complete);
 
-char libcfs_debug_file_path_arr[PATH_MAX] = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
-EXPORT_SYMBOL(libcfs_debug_file_path_arr);
-
 /* We need to pass a pointer here, but elsewhere this must be a const */
-static char *libcfs_debug_file_path = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
+char *libcfs_debug_file_path = LIBCFS_DEBUG_FILE_PATH_DEFAULT;
+EXPORT_SYMBOL(libcfs_debug_file_path);
 module_param(libcfs_debug_file_path, charp, 0644);
 MODULE_PARM_DESC(libcfs_debug_file_path,
 		 "Path for dumping debug logs, set 'NONE' to prevent log dumping");
@@ -379,12 +377,12 @@ static void libcfs_debug_dumplog_internal(void *arg)
 
 	current_time = ktime_get_real_seconds();
 
-	if (strncmp(libcfs_debug_file_path_arr, "NONE", 4) &&
+	if (strncmp(libcfs_debug_file_path, "NONE", 4) != 0 &&
 	    current_time > last_dump_time) {
 		last_dump_time = current_time;
 		snprintf(debug_file_name, sizeof(debug_file_name) - 1,
-			 "%s.%lld.%ld", libcfs_debug_file_path_arr,
-			 (s64)current_time, (long)arg);
+			 "%s.%lld.%ld", libcfs_debug_file_path,
+			 (s64)current_time, (uintptr_t)arg);
 		pr_alert("LustreError: dumping log to %s\n", debug_file_name);
 		cfs_tracefile_dump_all_pages(debug_file_name);
 		libcfs_run_debug_log_upcall(debug_file_name);
@@ -545,12 +543,6 @@ int libcfs_debug_init(unsigned long bufsize)
 		libcfs_console_min_delay = CDEBUG_DEFAULT_MIN_DELAY;
 	}
 
-	if (libcfs_debug_file_path) {
-		strlcpy(libcfs_debug_file_path_arr,
-			libcfs_debug_file_path,
-			sizeof(libcfs_debug_file_path_arr));
-	}
-
 	/* If libcfs_debug_mb is uninitialized then just make the
 	 * total buffers smp_num_cpus * TCD_MAX_PAGES
 	 */
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 17/29] lnet: Use lr_hops for avoid_asym_router_failure
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (15 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 16/29] lnet: libcfs: fix setting of debug_path James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 18/29] lnet: Leverage peer aliveness more efficiently James Simmons
                   ` (11 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown
  Cc: Chris Horn, Lustre Development List

From: Chris Horn <chris.horn@hpe.com>

In order for the asymmetric route failure avoidance feature to work
properly it needs to know what the hop count of a route should be.
This information is defined by the lr_hops field of the lnet_route.
The lr_single_hop is what discovery was able to determine the hop
count actually is (single or multi) based on the last ping reply.
If a remote interface on a router goes missing, the route may be
classified as multi-hop by discovery, but it should be considered
single-hop for the purposes of avoiding asymmetric route failure.

HPE-bug-id: LUS-9099
WC-bug-id: https://jira.whamcloud.com/browse/LU-13785
Lustre-commit: 2e07619477684f28 ("LU-13785 lnet: Use lr_hops for avoid_asym_router_failure")
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Reviewed-on: https://review.whamcloud.com/39362
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/lnet/router.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/net/lnet/lnet/router.c b/net/lnet/lnet/router.c
index ee3c15f..af16263 100644
--- a/net/lnet/lnet/router.c
+++ b/net/lnet/lnet/router.c
@@ -317,7 +317,8 @@ bool lnet_is_route_alive(struct lnet_route *route)
 	 * that the remote net must exist on the gateway. For multi-hop
 	 * routes the next-hop will not have the remote net.
 	 */
-	if (avoid_asym_router_failure && route->lr_single_hop) {
+	if (avoid_asym_router_failure &&
+	    (route->lr_hops == 1 || route->lr_hops == LNET_UNDEFINED_HOPS)) {
 		rlpn = lnet_peer_get_net_locked(gw, route->lr_net);
 		if (!rlpn)
 			return false;
@@ -367,7 +368,8 @@ bool lnet_is_route_alive(struct lnet_route *route)
 static inline void
 lnet_check_route_inconsistency(struct lnet_route *route)
 {
-	if (!route->lr_single_hop && (int)route->lr_hops <= 1) {
+	if (!route->lr_single_hop &&
+	    (route->lr_hops == 1 || route->lr_hops == LNET_UNDEFINED_HOPS)) {
 		CWARN("route %s->%s is detected to be multi-hop but hop count is set to %d\n",
 		      libcfs_net2str(route->lr_net),
 		      libcfs_nid2str(route->lr_gateway->lp_primary_nid),
@@ -482,7 +484,9 @@ bool lnet_is_route_alive(struct lnet_route *route)
 		}
 
 		route->lr_single_hop = single_hop;
-		if (avoid_asym_router_failure && single_hop)
+		if (avoid_asym_router_failure &&
+		    (route->lr_hops == 1 ||
+		     route->lr_hops == LNET_UNDEFINED_HOPS))
 			lnet_set_route_aliveness(route, net_up);
 		else
 			lnet_set_route_aliveness(route, true);
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 18/29] lnet: Leverage peer aliveness more efficiently
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (16 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 17/29] lnet: Use lr_hops for avoid_asym_router_failure James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 19/29] lustre: mdt: mkdir should return -EEXIST if exists James Simmons
                   ` (10 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown
  Cc: Chris Horn, Lustre Development List

From: Chris Horn <chris.horn@hpe.com>

When an LNet router is revived after going down, remote peers may
discover it is alive before we do. Thus, remote peers may use it
as a next-hop, and we may start receiving messages from it while we
still consider it to be dead. We should mark router peers as alive
when we receive a message from them.

If an LNet router does not respond to a discovery ping, then we
currently mark all of its NIs as DOWN. This can actually slow down
the process of returning a route to service. If we receive a message
from a router, in the manner described above, then we can safely
return the router to service. We already set the status of the router
NI we received the message from to UP, but the remote NIs will still
be DOWN and thus the route will be considered down until we get a
reply to the next discovery ping.

When selecting a route, we only consider the aliveness of a gateway's
remote NIs if avoid_asym_router_failure is enabled and the route is
single-hop. In this case, as long as the gateway has at least one
alive NI on the remote network then the route is considered UP. In
the situation described above, we know the router has at least one
NI alive because it was used to forward a message from a remote peer.
Thus, when we receive a forwarded message from a router, we can
reasonably set the NI status of all of its NIs that are on the same
peer net as the message originator to UP. This does not impact the
route status of any multi-hop routes because we do not consider the
aliveness of remote NIs for multi-hop routes.

Similarly, we can set the cached lr_alive value to up for any routes
whose lr_net matches the net ID of the message originator NID. This
variable is converted to an atomic_t to get rid of the need for
global locking when updating it.

HPE-bug-id: LUS-9088
WC-bug-id: https://jira.whamcloud.com/browse/LU-13780
Lustre-commit: 886e34ce56c491e8 ("LU-13780 lnet: Leverage peer aliveness more efficiently")
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Reviewed-on: https://review.whamcloud.com/39350
Reviewed-by: Neil Brown <neilb@suse.de>
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 include/linux/lnet/lib-lnet.h  | 12 ++++++++++++
 include/linux/lnet/lib-types.h |  2 +-
 net/lnet/lnet/lib-move.c       | 37 ++++++++++++++++++++++++++++++++++---
 net/lnet/lnet/router.c         | 29 ++++++-----------------------
 4 files changed, 53 insertions(+), 27 deletions(-)

diff --git a/include/linux/lnet/lib-lnet.h b/include/linux/lnet/lib-lnet.h
index 4712e2d..fd24c10 100644
--- a/include/linux/lnet/lib-lnet.h
+++ b/include/linux/lnet/lib-lnet.h
@@ -1040,4 +1040,16 @@ u32 lnet_sum_stats(struct lnet_element_stats *stats,
 void lnet_usr_translate_stats(struct lnet_ioctl_element_msg_stats *msg_stats,
 			      struct lnet_element_stats *stats);
 
+static inline void
+lnet_set_route_aliveness(struct lnet_route *route, bool alive)
+{
+	bool old = atomic_xchg(&route->lr_alive, alive);
+
+	if (old != alive)
+		CERROR("route to %s through %s has gone from %s to %s\n",
+		       libcfs_net2str(route->lr_net),
+		       libcfs_nid2str(route->lr_gateway->lp_primary_nid),
+		       old ? "up" : "down",
+		       alive ? "up" : "down");
+}
 #endif
diff --git a/include/linux/lnet/lib-types.h b/include/linux/lnet/lib-types.h
index f479efe..a6a7588 100644
--- a/include/linux/lnet/lib-types.h
+++ b/include/linux/lnet/lib-types.h
@@ -868,7 +868,7 @@ struct lnet_route {
 	/* route priority */
 	unsigned int		lr_priority;
 	/* cached route aliveness */
-	bool			lr_alive;
+	atomic_t		lr_alive;
 	/* this route is single-hop */
 	bool			lr_single_hop;
 };
diff --git a/net/lnet/lnet/lib-move.c b/net/lnet/lnet/lib-move.c
index ad1517d..a9399cc 100644
--- a/net/lnet/lnet/lib-move.c
+++ b/net/lnet/lnet/lib-move.c
@@ -4360,7 +4360,12 @@ void lnet_monitor_thr_stop(void)
 		goto drop;
 	}
 
-	if (lnet_drop_asym_route && for_me &&
+	/* If this message was forwarded to us from a router then we may need
+	 * to update router aliveness or check for an asymmetrical route
+	 * (or both)
+	 */
+	if (((lnet_drop_asym_route && for_me) ||
+	     !lpni->lpni_peer_net->lpn_peer->lp_alive) &&
 	    LNET_NIDNET(src_nid) != LNET_NIDNET(from_nid)) {
 		u32 src_net_id = LNET_NIDNET(src_nid);
 		struct lnet_peer *gw = lpni->lpni_peer_net->lpn_peer;
@@ -4370,10 +4375,24 @@ void lnet_monitor_thr_stop(void)
 		list_for_each_entry(route, &gw->lp_routes, lr_gwlist) {
 			if (route->lr_net == src_net_id) {
 				found = true;
-				break;
+				/* If we're transitioning the gateway from
+				 * dead -> alive, and discovery is disabled
+				 * locally or on the gateway, then we need to
+				 * update the cached route aliveness for each
+				 * route to the src_nid's net.
+				 *
+				 * Otherwise, we're only checking for
+				 * symmetrical route, and we can break the
+				 * loop
+				 */
+				if (!gw->lp_alive &&
+				    lnet_is_discovery_disabled(gw))
+					lnet_set_route_aliveness(route, true);
+				else
+					break;
 			}
 		}
-		if (!found) {
+		if (lnet_drop_asym_route && for_me && !found) {
 			lnet_net_unlock(cpt);
 			/* we would not use from_nid to route a message to
 			 * src_nid
@@ -4385,6 +4404,18 @@ void lnet_monitor_thr_stop(void)
 			kfree(msg);
 			goto drop;
 		}
+		if (!gw->lp_alive) {
+			struct lnet_peer_net *lpn;
+			struct lnet_peer_ni *lpni2;
+
+			gw->lp_alive = true;
+			/* Mark all remote NIs on src_nid's net UP */
+			lpn = lnet_peer_get_net_locked(gw, src_net_id);
+			if (lpn)
+				list_for_each_entry(lpni2, &lpn->lpn_peer_nis,
+						    lpni_peer_nis)
+					lpni2->lpni_ns_status = LNET_NI_STATUS_UP;
+		}
 	}
 
 	lpni->lpni_last_alive = ktime_get_seconds();
diff --git a/net/lnet/lnet/router.c b/net/lnet/lnet/router.c
index af16263..ae7582ca 100644
--- a/net/lnet/lnet/router.c
+++ b/net/lnet/lnet/router.c
@@ -303,7 +303,7 @@ bool lnet_is_route_alive(struct lnet_route *route)
 	 * enabled.
 	 */
 	if (lnet_is_discovery_disabled(gw))
-		return route->lr_alive;
+		return atomic_read(&route->lr_alive) == 1;
 
 	/* check the gateway's interfaces on the local network */
 	llpn = lnet_peer_get_net_locked(gw, route->lr_lnet);
@@ -394,21 +394,6 @@ bool lnet_is_route_alive(struct lnet_route *route)
 }
 
 /* Must hold net_lock/EX */
-static inline void
-lnet_set_route_aliveness(struct lnet_route *route, bool alive)
-{
-	/* Log when there's a state change */
-	if (route->lr_alive != alive) {
-		CERROR("route to %s through %s has gone from %s to %s\n",
-		       libcfs_net2str(route->lr_net),
-		       libcfs_nid2str(route->lr_gateway->lp_primary_nid),
-		       (route->lr_alive) ? "up" : "down",
-		       alive ? "up" : "down");
-		route->lr_alive = alive;
-	}
-}
-
-/* Must hold net_lock/EX */
 void
 lnet_router_discovery_ping_reply(struct lnet_peer *lp)
 {
@@ -706,6 +691,10 @@ static void lnet_shuffle_seed(void)
 	route->lr_nid = gateway;
 	route->lr_priority = priority;
 	route->lr_hops = hops;
+	if (lnet_peers_start_down())
+		atomic_set(&route->lr_alive, 0);
+	else
+		atomic_set(&route->lr_alive, 1);
 
 	lnet_net_lock(LNET_LOCK_EX);
 
@@ -1770,14 +1759,8 @@ bool lnet_router_checker_active(void)
 		 */
 		if (lnet_is_discovery_disabled(lp)) {
 			list_for_each_entry(route, &lp->lp_routes, lr_gwlist) {
-				if (route->lr_nid == lpni->lpni_nid &&
-				    route->lr_alive != alive) {
-					lnet_net_unlock(0);
-					lnet_net_lock(LNET_LOCK_EX);
+				if (route->lr_nid == lpni->lpni_nid)
 					lnet_set_route_aliveness(route, alive);
-					lnet_net_unlock(LNET_LOCK_EX);
-					lnet_net_lock(0);
-				}
 			}
 		}
 	}
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 19/29] lustre: mdt: mkdir should return -EEXIST if exists
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (17 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 18/29] lnet: Leverage peer aliveness more efficiently James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 20/29] lnet: o2iblnd: don't resend if there's no listener James Simmons
                   ` (9 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lai Siyao, Lustre Development List

From: Lai Siyao <lai.siyao@whamcloud.com>

lfs setdirstripe' will try restripe if target exists, however
it's confusing to get -ENOTSUPP or -EALREADY for 'lfs mkdir', while
the latter invokes the same function as 'lfs setdirstripe'.

Pack MDS_OPEN_CREAT flag in request for 'lfs mkdir', and MDT won't
try restripe if it's set.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14366
Lustre-commit: 65e3e4050ec5bb371 ("LU-14366 mdt: lfs mkdir should return -EEXIST if exists")
Signed-off-by: Lai Siyao <lai.siyao@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/41329
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yingjin Qian <qian@ddn.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/llite/dir.c                  | 11 +++++++++--
 fs/lustre/mdc/mdc_lib.c                |  5 +++++
 include/uapi/linux/lustre/lustre_idl.h |  2 ++
 3 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/fs/lustre/llite/dir.c b/fs/lustre/llite/dir.c
index 76294ff5..21b40d1 100644
--- a/fs/lustre/llite/dir.c
+++ b/fs/lustre/llite/dir.c
@@ -373,7 +373,8 @@ static int ll_readdir(struct file *filp, struct dir_context *ctx)
  *		<0 if the creation is failed.
  */
 static int ll_dir_setdirstripe(struct dentry *dparent, struct lmv_user_md *lump,
-			       size_t len, const char *dirname, umode_t mode)
+			       size_t len, const char *dirname, umode_t mode,
+			       bool createonly)
 {
 	struct inode *parent = dparent->d_inode;
 	struct ptlrpc_request *request = NULL;
@@ -482,6 +483,9 @@ static int ll_dir_setdirstripe(struct dentry *dparent, struct lmv_user_md *lump,
 	}
 
 	op_data->op_cli_flags |= CLI_SET_MEA;
+	if (createonly)
+		op_data->op_bias |= MDS_SETSTRIPE_CREATE;
+
 	err = md_create(sbi->ll_md_exp, op_data, lump, len, mode,
 			from_kuid(&init_user_ns, current_fsuid()),
 			from_kgid(&init_user_ns, current_fsgid()),
@@ -1378,6 +1382,7 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		int namelen = 0;
 		int lumlen = 0;
 		umode_t mode;
+		bool createonly = false;
 		int len;
 		int rc;
 
@@ -1427,7 +1432,9 @@ static long ll_dir_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
 		}
 
 		mode = data->ioc_type;
-		rc = ll_dir_setdirstripe(dentry, lum, lumlen, filename, mode);
+		createonly = data->ioc_obdo1.o_flags & OBD_FL_OBDMDEXISTS;
+		rc = ll_dir_setdirstripe(dentry, lum, lumlen, filename, mode,
+					 createonly);
 lmv_out_free:
 		kvfree(data);
 		return rc;
diff --git a/fs/lustre/mdc/mdc_lib.c b/fs/lustre/mdc/mdc_lib.c
index 9251aec..69261b2 100644
--- a/fs/lustre/mdc/mdc_lib.c
+++ b/fs/lustre/mdc/mdc_lib.c
@@ -212,6 +212,11 @@ void mdc_create_pack(struct ptlrpc_request *req, struct md_op_data *op_data,
 	flags = 0;
 	if (op_data->op_bias & MDS_CREATE_VOLATILE)
 		flags |= MDS_OPEN_VOLATILE;
+	if (op_data->op_bias & MDS_SETSTRIPE_CREATE)
+		/* borrow MDS_OPEN_CREATE flag to indicate current setstripe
+		 * create only, and don't restripe if object exists.
+		 */
+		flags |= MDS_OPEN_CREAT;
 	set_mrc_cr_flags(rec, flags);
 	rec->cr_bias = op_data->op_bias;
 	rec->cr_umask = current_umask();
diff --git a/include/uapi/linux/lustre/lustre_idl.h b/include/uapi/linux/lustre/lustre_idl.h
index d71fe47..c79010b 100644
--- a/include/uapi/linux/lustre/lustre_idl.h
+++ b/include/uapi/linux/lustre/lustre_idl.h
@@ -1736,6 +1736,8 @@ enum mds_op_bias {
 	MDS_TRUNC_KEEP_LEASE	= 1 << 18,
 	MDS_PCC_ATTACH		= 1 << 19,
 	MDS_CLOSE_UPDATE_TIMES	= 1 << 20,
+	/* setstripe create only, don't restripe if target exists */
+	 MDS_SETSTRIPE_CREATE	= 1 << 21,
 };
 
 #define MDS_CLOSE_INTENT (MDS_HSM_RELEASE | MDS_CLOSE_LAYOUT_SWAP |         \
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 20/29] lnet: o2iblnd: don't resend if there's no listener
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (18 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 19/29] lustre: mdt: mkdir should return -EEXIST if exists James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 21/29] lnet: obi2lnd: don't try to reconnect " James Simmons
                   ` (8 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown
  Cc: Li Dongyang, Lustre Development List

From: Li Dongyang <dongyangli@ddn.com>

If there's no listener at remote peer, we will
get IB_CM_REJ_INVALID_SERVICE_ID, currently we
will try to resend which makes the discovery longer
than necessary when connecting to a node which is
not up.
Use -EHOSTUNREACH instead of -ECONNREFUSED,
so we don't end up queued for resend.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14536
Lustre-commit: 67ba3ce23d32266e ("LU-14536 o2iblnd: don't resend if there's no listener")
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/42109
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Chris Horn <chris.horn@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
index 6445f0a..e5e5e02 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -2745,6 +2745,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 kiblnd_rejected(struct kib_conn *conn, int reason, void *priv, int priv_nob)
 {
 	struct kib_peer_ni *peer_ni = conn->ibc_peer;
+	int status = -ECONNREFUSED;
 
 	LASSERT(!in_interrupt());
 	LASSERT(conn->ibc_state == IBLND_CONN_ACTIVE_CONNECT);
@@ -2756,6 +2757,8 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 		break;
 
 	case IB_CM_REJ_INVALID_SERVICE_ID:
+		status = -EHOSTUNREACH;
+		peer_ni->ibp_retries++;
 		kiblnd_check_reconnect(conn, IBLND_MSG_VERSION, 0,
 				       IBLND_REJECT_INVALID_SRV_ID, NULL);
 		CNETERR("%s rejected: no listener at %d\n",
@@ -2870,7 +2873,7 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 		break;
 	}
 
-	kiblnd_connreq_done(conn, -ECONNREFUSED);
+	kiblnd_connreq_done(conn, status);
 }
 
 static void
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 21/29] lnet: obi2lnd: don't try to reconnect if there's no listener
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (19 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 20/29] lnet: o2iblnd: don't resend if there's no listener James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 22/29] lustre: osc: fall back to vmalloc for large RPCs James Simmons
                   ` (7 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown
  Cc: Li Dongyang, Lustre Development List

From: Li Dongyang <dongyangli@ddn.com>

For each discovery we try to reconnect up to retry_count times,
default to 5. during MDT mount process conf log, there will be
multiple discovery made for each OST.
If the OSTs are not up, the mount will have a long time out.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14536
Lustre-commit: 67ba3ce23d32266e ("LU-14536 obi2lnd: don't try to reconnect if there's no listener")
Signed-off-by: Li Dongyang <dongyangli@ddn.com>
Reviewed-on: https://review.whamcloud.com/42111
Reviewed-by: Serguei Smirnov <ssmirnov@whamcloud.com>
Reviewed-by: Amir Shehata <ashehata@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 net/lnet/klnds/o2iblnd/o2iblnd.h    |  2 --
 net/lnet/klnds/o2iblnd/o2iblnd_cb.c | 16 ----------------
 2 files changed, 18 deletions(-)

diff --git a/net/lnet/klnds/o2iblnd/o2iblnd.h b/net/lnet/klnds/o2iblnd/o2iblnd.h
index a5a66ee..c578673 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd.h
+++ b/net/lnet/klnds/o2iblnd/o2iblnd.h
@@ -510,8 +510,6 @@ struct kib_peer_ni {
 	unsigned char		ibp_races;
 	/* # consecutive reconnection attempts to this peer_ni */
 	unsigned int		ibp_reconnected;
-	/* number of total active retries */
-	unsigned int		ibp_retries;
 	/* errno on closing this peer_ni */
 	int			ibp_error;
 	/* max map_on_demand */
diff --git a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
index e5e5e02..de3b42e 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -2201,9 +2201,6 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 	/* connection established */
 	write_lock_irqsave(&kiblnd_data.kib_global_lock, flags);
 
-	/* reset retry count */
-	peer_ni->ibp_retries = 0;
-
 	conn->ibc_last_send = ktime_get();
 	kiblnd_set_conn_state(conn, IBLND_CONN_ESTABLISHED);
 	kiblnd_peer_alive(peer_ni);
@@ -2654,11 +2651,6 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 		goto out;
 	}
 
-	if (peer_ni->ibp_retries > *kiblnd_tunables.kib_retry_count) {
-		reason = "retry count exceeded due to no listener";
-		goto out;
-	}
-
 	switch (why) {
 	default:
 		reason = "Unknown";
@@ -2714,11 +2706,6 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 	case IBLND_REJECT_CONN_UNCOMPAT:
 		reason = "version negotiation";
 		break;
-
-	case IBLND_REJECT_INVALID_SRV_ID:
-		peer_ni->ibp_retries++;
-		reason = "invalid service id";
-		break;
 	}
 
 	conn->ibc_reconnect = 1;
@@ -2758,9 +2745,6 @@ static int kiblnd_map_tx(struct lnet_ni *ni, struct kib_tx *tx,
 
 	case IB_CM_REJ_INVALID_SERVICE_ID:
 		status = -EHOSTUNREACH;
-		peer_ni->ibp_retries++;
-		kiblnd_check_reconnect(conn, IBLND_MSG_VERSION, 0,
-				       IBLND_REJECT_INVALID_SRV_ID, NULL);
 		CNETERR("%s rejected: no listener at %d\n",
 			libcfs_nid2str(peer_ni->ibp_nid),
 			*kiblnd_tunables.kib_service);
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 22/29] lustre: osc: fall back to vmalloc for large RPCs
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (20 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 21/29] lnet: obi2lnd: don't try to reconnect " James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 23/29] lustre: ldlm: discard l_lock from struct ldlm_lock James Simmons
                   ` (6 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Andreas Dilger <adilger@whamcloud.com>

For large RPC sizes (16MB+) the page array (4096 brw_page) can
become very large (128KB+ with fscrypt) and should fall back to
vmalloc() if kmalloc() fails due to memory fragmentation.

The mdc/mdt allocations are currently limited to 1MB for readdir
RPCs, but it doesn't hurt to prepare them for larger RPCs from
clients in the future if this limit is increased.

Fixes: 5965de814e91 ("staging: lustre: rpc: increase bulk size")
WC-bug-id: https://jira.whamcloud.com/browse/LU-13212
Lustre-commit: 037a9e2cf6d5b8d6f ("LU-13212 osc: fall back to vmalloc for large RPCs")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/43281
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/mdc/mdc_request.c     | 5 +++--
 fs/lustre/mgc/mgc_request.c     | 5 +++--
 fs/lustre/obdecho/echo_client.c | 5 +++--
 fs/lustre/osc/osc_request.c     | 5 +++--
 4 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/fs/lustre/mdc/mdc_request.c b/fs/lustre/mdc/mdc_request.c
index 6ac3a39..fb9971f 100644
--- a/fs/lustre/mdc/mdc_request.c
+++ b/fs/lustre/mdc/mdc_request.c
@@ -1312,7 +1312,8 @@ static int mdc_read_page_remote(void *data, struct page *page0)
 	fid = &op_data->op_fid1;
 	LASSERT(inode);
 
-	page_pool = kcalloc(max_pages, sizeof(page), GFP_NOFS);
+	page_pool = kvmalloc_array(max_pages, sizeof(page),
+				   GFP_KERNEL | __GFP_ZERO);
 	if (page_pool) {
 		page_pool[0] = page0;
 	} else {
@@ -1381,7 +1382,7 @@ static int mdc_read_page_remote(void *data, struct page *page0)
 	}
 
 	if (page_pool != &page0)
-		kfree(page_pool);
+		kvfree(page_pool);
 
 	return rc;
 }
diff --git a/fs/lustre/mgc/mgc_request.c b/fs/lustre/mgc/mgc_request.c
index f115479..4b60056a 100644
--- a/fs/lustre/mgc/mgc_request.c
+++ b/fs/lustre/mgc/mgc_request.c
@@ -1350,7 +1350,8 @@ static int mgc_process_recover_log(struct obd_device *obd,
 	if (cfg->cfg_last_idx == 0) /* the first time */
 		nrpages = CONFIG_READ_NRPAGES_INIT;
 
-	pages = kcalloc(nrpages, sizeof(*pages), GFP_KERNEL);
+	pages = kvmalloc_array(nrpages, sizeof(*pages),
+			       GFP_KERNEL | __GFP_ZERO);
 	if (!pages) {
 		rc = -ENOMEM;
 		goto out;
@@ -1474,7 +1475,7 @@ static int mgc_process_recover_log(struct obd_device *obd,
 				break;
 			__free_page(pages[i]);
 		}
-		kfree(pages);
+		kvfree(pages);
 	}
 	return rc;
 }
diff --git a/fs/lustre/obdecho/echo_client.c b/fs/lustre/obdecho/echo_client.c
index 3bee0c2..270226b 100644
--- a/fs/lustre/obdecho/echo_client.c
+++ b/fs/lustre/obdecho/echo_client.c
@@ -1302,7 +1302,8 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
 	if (!pga)
 		return -ENOMEM;
 
-	pages = kcalloc(npages, sizeof(*pages), GFP_NOFS);
+	pages = kvmalloc_array(npages, sizeof(*pages),
+			       GFP_KERNEL | __GFP_ZERO);
 	if (!pages) {
 		kfree(pga);
 		return -ENOMEM;
@@ -1355,7 +1356,7 @@ static int echo_client_kbrw(struct echo_device *ed, int rw, struct obdo *oa,
 		__free_page(pgp->pg);
 	}
 	kfree(pga);
-	kfree(pages);
+	kvfree(pages);
 	return rc;
 }
 
diff --git a/fs/lustre/osc/osc_request.c b/fs/lustre/osc/osc_request.c
index 1bd0d2c..973c504 100644
--- a/fs/lustre/osc/osc_request.c
+++ b/fs/lustre/osc/osc_request.c
@@ -2323,7 +2323,7 @@ static void sort_brw_pages(struct brw_page **array, int num)
 static void osc_release_ppga(struct brw_page **ppga, u32 count)
 {
 	LASSERT(ppga);
-	kfree(ppga);
+	kvfree(ppga);
 }
 
 static int brw_interpret(const struct lu_env *env,
@@ -2523,7 +2523,8 @@ int osc_build_rpc(const struct lu_env *env, struct client_obd *cli,
 	if (mem_tight)
 		mpflag = memalloc_noreclaim_save();
 
-	pga = kcalloc(page_count, sizeof(*pga), GFP_NOFS);
+	pga = kvmalloc_array(page_count, sizeof(*pga),
+			     GFP_KERNEL | __GFP_ZERO);
 	if (!pga) {
 		rc = -ENOMEM;
 		goto out;
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 23/29] lustre: ldlm: discard l_lock from struct ldlm_lock.
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (21 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 22/29] lustre: osc: fall back to vmalloc for large RPCs James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 24/29] lustre: llite: do fallocate() size checks under lock James Simmons
                   ` (5 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Mr NeilBrown <neilb@suse.de>

This spinlock (l_lock) is only used to stablise the l_resource
pointer while taking a spinlock on the resource.

This is not necessary - it is sufficient to take the resource
spinlock, and then check if l_resource has changed or not.  If it
hasn't then it cannot change until the resource spinlock is dropped.

We must ensure this is safe even if the resource is freed before
lock_res_and_lock() managed to get the lock.  To do this we mark the
slab as SLAB_TYPESAFE_BY_RCU and initialise the lock in an
init_once() function, but not on every allocate (and specifically
don't zero the whole struct on each allocation). This means that if
we find a resource after taking the RCU read lock, then it is always
safe to take and then drop the spinlock. After taking the spinlock,
we can check if it is more generally safe to use.

Discarding l_lock shrinks 'struct ldlm_lock' which helps save memory.

WC-bug-id: https://jira.whamcloud.com/browse/LU-4801
Lustre-commit: bb6edb7b8eeec65f4 ("LU-4801 ldlm: discard l_lock from struct ldlm_lock.")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/39811
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/include/lustre_dlm.h | 17 +++++++++--------
 fs/lustre/ldlm/l_lock.c        | 27 +++++++++++++++------------
 fs/lustre/ldlm/ldlm_lock.c     | 28 ++++++++++++++--------------
 fs/lustre/ldlm/ldlm_lockd.c    | 22 +++++++++++++++++++++-
 fs/lustre/ldlm/ldlm_resource.c | 12 +++++-------
 5 files changed, 64 insertions(+), 42 deletions(-)

diff --git a/fs/lustre/include/lustre_dlm.h b/fs/lustre/include/lustre_dlm.h
index f1828df..1fc199b 100644
--- a/fs/lustre/include/lustre_dlm.h
+++ b/fs/lustre/include/lustre_dlm.h
@@ -649,13 +649,10 @@ struct ldlm_lock {
 	 */
 	struct portals_handle		l_handle;
 	/**
-	 * Internal spinlock protects l_resource.  We should hold this lock
-	 * first before taking res_lock.
-	 */
-	spinlock_t			l_lock;
-	/**
 	 * Pointer to actual resource this lock is in.
-	 * ldlm_lock_change_resource() can change this.
+	 * ldlm_lock_change_resource() can change this on the client.
+	 * When this is possible, rcu must be used to stablise
+	 * the resource while we lock and check it hasn't been changed.
 	 */
 	struct ldlm_resource		*l_resource;
 	/**
@@ -889,9 +886,13 @@ struct ldlm_resource {
 
 	/**
 	 * List item for list in namespace hash.
-	 * protected by ns_lock
+	 * protected by ns_lock.
+	 * Shared with linkage for RCU-delayed free.
 	 */
-	struct hlist_node		lr_hash;
+	union {
+		struct hlist_node		lr_hash;
+		struct rcu_head			lr_rcu;
+	};
 
 	/** Reference count for this resource */
 	atomic_t			lr_refcount;
diff --git a/fs/lustre/ldlm/l_lock.c b/fs/lustre/ldlm/l_lock.c
index 296259a..3531420 100644
--- a/fs/lustre/ldlm/l_lock.c
+++ b/fs/lustre/ldlm/l_lock.c
@@ -41,19 +41,25 @@
  *
  * LDLM locking uses resource to serialize access to locks
  * but there is a case when we change resource of lock upon
- * enqueue reply. We rely on lock->l_resource = new_res
+ * enqueue reply. We rely on rcu_assign_pointer(lock->l_resource, new_res)
  * being an atomic operation.
  */
 struct ldlm_resource *lock_res_and_lock(struct ldlm_lock *lock)
-				__acquires(&lock->l_lock)
-				__acquires(&lock->l_resource->lr_lock)
+__acquires(&lock->l_resource->lr_lock)
 {
-	spin_lock(&lock->l_lock);
+	struct ldlm_resource *res;
 
-	lock_res(lock->l_resource);
-
-	ldlm_set_res_locked(lock);
-	return lock->l_resource;
+	rcu_read_lock();
+	while (1) {
+		res = rcu_dereference(lock->l_resource);
+		lock_res(res);
+		if (res == lock->l_resource) {
+			ldlm_set_res_locked(lock);
+			rcu_read_unlock();
+			return res;
+		}
+		unlock_res(res);
+	}
 }
 EXPORT_SYMBOL(lock_res_and_lock);
 
@@ -61,13 +67,10 @@ struct ldlm_resource *lock_res_and_lock(struct ldlm_lock *lock)
  * Unlock a lock and its resource previously locked with lock_res_and_lock
  */
 void unlock_res_and_lock(struct ldlm_lock *lock)
-		__releases(&lock->l_resource->lr_lock)
-		__releases(&lock->l_lock)
+__releases(&lock->l_resource->lr_lock)
 {
-	/* on server-side resource of lock doesn't change */
 	ldlm_clear_res_locked(lock);
 
 	unlock_res(lock->l_resource);
-	spin_unlock(&lock->l_lock);
 }
 EXPORT_SYMBOL(unlock_res_and_lock);
diff --git a/fs/lustre/ldlm/ldlm_lock.c b/fs/lustre/ldlm/ldlm_lock.c
index b7ce0bb..c872455 100644
--- a/fs/lustre/ldlm/ldlm_lock.c
+++ b/fs/lustre/ldlm/ldlm_lock.c
@@ -385,8 +385,7 @@ static struct ldlm_lock *ldlm_lock_new(struct ldlm_resource *resource)
 	if (!lock)
 		return NULL;
 
-	spin_lock_init(&lock->l_lock);
-	lock->l_resource = resource;
+	RCU_INIT_POINTER(lock->l_resource, resource);
 	lu_ref_add(&resource->lr_reference, "lock", lock);
 
 	refcount_set(&lock->l_handle.h_ref, 2);
@@ -455,12 +454,13 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock,
 
 	lu_ref_add(&newres->lr_reference, "lock", lock);
 	/*
-	 * To flip the lock from the old to the new resource, lock, oldres and
-	 * newres have to be locked. Resource spin-locks are nested within
-	 * lock->l_lock, and are taken in the memory address order to avoid
-	 * dead-locks.
+	 * To flip the lock from the old to the new resource, oldres
+	 * and newres have to be locked. Resource spin-locks are taken
+	 * in the memory address order to avoid dead-locks.
+	 * As this is the only circumstance where ->l_resource
+	 * can change, and this cannot race with itself, it is safe
+	 * to access lock->l_resource without being careful about locking.
 	 */
-	spin_lock(&lock->l_lock);
 	oldres = lock->l_resource;
 	if (oldres < newres) {
 		lock_res(oldres);
@@ -471,9 +471,9 @@ int ldlm_lock_change_resource(struct ldlm_namespace *ns, struct ldlm_lock *lock,
 	}
 	LASSERT(memcmp(new_resid, &oldres->lr_name,
 		       sizeof(oldres->lr_name)) != 0);
-	lock->l_resource = newres;
+	rcu_assign_pointer(lock->l_resource, newres);
 	unlock_res(oldres);
-	unlock_res_and_lock(lock);
+	unlock_res(newres);
 
 	/* ...and the flowers are still standing! */
 	lu_ref_del(&oldres->lr_reference, "lock", lock);
@@ -1875,11 +1875,11 @@ void _ldlm_lock_debug(struct ldlm_lock *lock,
 	va_list args;
 	struct va_format vaf;
 
-	if (spin_trylock(&lock->l_lock)) {
-		if (lock->l_resource)
-			resource = ldlm_resource_getref(lock->l_resource);
-		spin_unlock(&lock->l_lock);
-	}
+	rcu_read_lock();
+	resource = rcu_dereference(lock->l_resource);
+	if (resource && !atomic_inc_not_zero(&resource->lr_refcount))
+		resource = NULL;
+	rcu_read_unlock();
 
 	va_start(args, fmt);
 	vaf.fmt = fmt;
diff --git a/fs/lustre/ldlm/ldlm_lockd.c b/fs/lustre/ldlm/ldlm_lockd.c
index 6f498cc..7d8bae2 100644
--- a/fs/lustre/ldlm/ldlm_lockd.c
+++ b/fs/lustre/ldlm/ldlm_lockd.c
@@ -1208,6 +1208,23 @@ static int ldlm_cleanup(void)
 	return 0;
 }
 
+void ldlm_resource_init_once(void *p)
+{
+	/*
+	 * It is import to initialise the spinlock only once,
+	 * as ldlm_lock_change_resource() could try to lock
+	 * the resource *after* it has been freed and possibly
+	 * reused. SLAB_TYPESAFE_BY_RCU ensures the memory won't
+	 * be freed while the lock is being taken, but we need to
+	 * ensure that it doesn't get reinitialized either.
+	 */
+	struct ldlm_resource *res = p;
+
+	memset(res, 0, sizeof(*res));
+	mutex_init(&res->lr_lvb_mutex);
+	spin_lock_init(&res->lr_lock);
+}
+
 int ldlm_init(void)
 {
 	mutex_init(&ldlm_ref_mutex);
@@ -1215,7 +1232,9 @@ int ldlm_init(void)
 	mutex_init(ldlm_namespace_lock(LDLM_NAMESPACE_CLIENT));
 	ldlm_resource_slab = kmem_cache_create("ldlm_resources",
 					       sizeof(struct ldlm_resource), 0,
-					       SLAB_HWCACHE_ALIGN, NULL);
+					       SLAB_TYPESAFE_BY_RCU |
+					       SLAB_HWCACHE_ALIGN,
+					       ldlm_resource_init_once);
 	if (!ldlm_resource_slab)
 		return -ENOMEM;
 
@@ -1248,6 +1267,7 @@ void ldlm_exit(void)
 {
 	if (ldlm_refcount)
 		CERROR("ldlm_refcount is %d in %s!\n", ldlm_refcount, __func__);
+	synchronize_rcu();
 	kmem_cache_destroy(ldlm_resource_slab);
 	/*
 	 * ldlm_lock_put() use RCU to call ldlm_lock_free, so need call
diff --git a/fs/lustre/ldlm/ldlm_resource.c b/fs/lustre/ldlm/ldlm_resource.c
index 481f14e..6e3feb2 100644
--- a/fs/lustre/ldlm/ldlm_resource.c
+++ b/fs/lustre/ldlm/ldlm_resource.c
@@ -1064,12 +1064,14 @@ static struct ldlm_resource *ldlm_resource_new(enum ldlm_type ldlm_type)
 {
 	struct ldlm_resource *res;
 
-	res = kmem_cache_zalloc(ldlm_resource_slab, GFP_NOFS);
+	res = kmem_cache_alloc(ldlm_resource_slab, GFP_NOFS);
 	if (!res)
 		return NULL;
 
 	INIT_LIST_HEAD(&res->lr_granted);
 	INIT_LIST_HEAD(&res->lr_waiting);
+	res->lr_lvb_inode = NULL;
+	res->lr_lvb_len = 0;
 
 	if (ldlm_type == LDLM_EXTENT) {
 		int idx;
@@ -1087,17 +1089,13 @@ static struct ldlm_resource *ldlm_resource_new(enum ldlm_type ldlm_type)
 			res->lr_itree[idx].lit_mode = BIT(idx);
 			res->lr_itree[idx].lit_root = RB_ROOT_CACHED;
 		}
+	} else {
+		res->lr_itree = NULL;
 	}
 
 	atomic_set(&res->lr_refcount, 1);
-	spin_lock_init(&res->lr_lock);
 	lu_ref_init(&res->lr_reference);
 
-	/* Since LVB init can be delayed now, there is no longer need to
-	 * immediately acquire mutex here.
-	 */
-	mutex_init(&res->lr_lvb_mutex);
-
 	return res;
 }
 
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 24/29] lustre: llite: do fallocate() size checks under lock
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (22 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 23/29] lustre: ldlm: discard l_lock from struct ldlm_lock James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 25/29] lustre: misc: limit CDEBUG console message frequency James Simmons
                   ` (4 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown
  Cc: Mikhail Pershin, Lustre Development List

From: Mikhail Pershin <mpershin@whamcloud.com>

Check about fallocate() range vs file size in vvp_io_setattr_start()
instead of ll_fallocate() so inode size cannot be changed by pending
write or truncate. This implies that IO is initialized already and
requires changes in LOV to update sub-IOs with proper inode size and
valid size attribute values

Fix also vvp_io_setattr_lock() to don't include fallocate_end in
lock range

WC-bug-id: https://jira.whamcloud.com/browse/LU-14433
Luste-commit: f23ac22c4c79750fe ("LU-14433 llite: do fallocate() size checks under lock")
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/41668
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/llite/file.c   |  5 -----
 fs/lustre/llite/vvp_io.c | 22 +++++++++++++++++++---
 fs/lustre/lov/lov_io.c   | 28 ++++++++++++++++++++++++++--
 3 files changed, 45 insertions(+), 10 deletions(-)

diff --git a/fs/lustre/llite/file.c b/fs/lustre/llite/file.c
index 1ca4589..c049433 100644
--- a/fs/lustre/llite/file.c
+++ b/fs/lustre/llite/file.c
@@ -5028,11 +5028,6 @@ int cl_falloc(struct inode *inode, int mode, loff_t offset, loff_t len)
 			rc = -EFBIG;
 			goto out;
 		}
-		io->u.ci_setattr.sa_attr.lvb_size = sa_falloc_end;
-		if (!(mode & FALLOC_FL_KEEP_SIZE))
-			io->u.ci_setattr.sa_avalid |= ATTR_SIZE;
-	} else {
-		io->u.ci_setattr.sa_attr.lvb_size = size;
 	}
 
 again:
diff --git a/fs/lustre/llite/vvp_io.c b/fs/lustre/llite/vvp_io.c
index cb59e94..38a9430 100644
--- a/fs/lustre/llite/vvp_io.c
+++ b/fs/lustre/llite/vvp_io.c
@@ -41,6 +41,8 @@
 #include <obd.h>
 #include <linux/pagevec.h>
 #include <linux/memcontrol.h>
+#include <linux/falloc.h>
+
 #include "llite_internal.h"
 #include "vvp_internal.h"
 
@@ -647,7 +649,7 @@ static int vvp_io_setattr_lock(const struct lu_env *env,
 			enqflags = CEF_DISCARD_DATA;
 	} else if (cl_io_is_fallocate(io)) {
 		lock_start = io->u.ci_setattr.sa_falloc_offset;
-		lock_end = io->u.ci_setattr.sa_falloc_end;
+		lock_end = io->u.ci_setattr.sa_falloc_end - 1;
 	} else {
 		unsigned int valid = io->u.ci_setattr.sa_avalid;
 
@@ -715,14 +717,27 @@ static int vvp_io_setattr_start(const struct lu_env *env,
 	struct cl_io *io = ios->cis_io;
 	struct inode *inode = vvp_object_inode(io->ci_obj);
 	struct ll_inode_info *lli = ll_i2info(inode);
+	int mode = io->u.ci_setattr.sa_falloc_mode;
 
 	if (cl_io_is_trunc(io)) {
 		trunc_sem_down_write(&lli->lli_trunc_sem);
 		mutex_lock(&lli->lli_setattr_mutex);
 		inode_dio_wait(inode);
 	} else if (cl_io_is_fallocate(io)) {
-		inode_lock(inode);
+		loff_t size;
+
+		trunc_sem_down_write(&lli->lli_trunc_sem);
+		mutex_lock(&lli->lli_setattr_mutex);
 		inode_dio_wait(inode);
+
+		ll_merge_attr(env, inode);
+		size = i_size_read(inode);
+		if (io->u.ci_setattr.sa_falloc_end > size &&
+		    !(mode & FALLOC_FL_KEEP_SIZE)) {
+			size = io->u.ci_setattr.sa_falloc_end;
+			io->u.ci_setattr.sa_avalid |= ATTR_SIZE;
+		}
+		io->u.ci_setattr.sa_attr.lvb_size = size;
 	} else {
 		mutex_lock(&lli->lli_setattr_mutex);
 	}
@@ -748,7 +763,8 @@ static void vvp_io_setattr_end(const struct lu_env *env,
 		mutex_unlock(&lli->lli_setattr_mutex);
 		trunc_sem_up_write(&lli->lli_trunc_sem);
 	} else if (cl_io_is_fallocate(io)) {
-		inode_unlock(inode);
+		mutex_unlock(&lli->lli_setattr_mutex);
+		trunc_sem_up_write(&lli->lli_trunc_sem);
 	} else {
 		mutex_unlock(&lli->lli_setattr_mutex);
 	}
diff --git a/fs/lustre/lov/lov_io.c b/fs/lustre/lov/lov_io.c
index ae9d547..7da0047 100644
--- a/fs/lustre/lov/lov_io.c
+++ b/fs/lustre/lov/lov_io.c
@@ -681,7 +681,7 @@ static void lov_io_sub_inherit(struct lov_io_sub *sub, struct lov_io *lio,
 			io->u.ci_setattr.sa_falloc_offset = start;
 			io->u.ci_setattr.sa_falloc_end = end;
 		}
-		if (cl_io_is_trunc(io) || cl_io_is_fallocate(io)) {
+		if (cl_io_is_trunc(io)) {
 			loff_t new_size = parent->u.ci_setattr.sa_attr.lvb_size;
 
 			new_size = lov_size_to_stripe(lsm, index, new_size,
@@ -1441,6 +1441,30 @@ static int lov_io_fault_start(const struct lu_env *env,
 	return lov_io_start(env, ios);
 }
 
+static int lov_io_setattr_start(const struct lu_env *env,
+				const struct cl_io_slice *ios)
+{
+	struct lov_io *lio = cl2lov_io(env, ios);
+	struct cl_io *parent = ios->cis_io;
+	struct lov_io_sub *sub;
+	struct lov_stripe_md *lsm = lio->lis_object->lo_lsm;
+
+	if (cl_io_is_fallocate(parent)) {
+		list_for_each_entry(sub, &lio->lis_active, sub_linkage) {
+			loff_t size = parent->u.ci_setattr.sa_attr.lvb_size;
+			int index = lov_comp_entry(sub->sub_subio_index);
+			int stripe = lov_comp_stripe(sub->sub_subio_index);
+
+			size = lov_size_to_stripe(lsm, index, size, stripe);
+			sub->sub_io.u.ci_setattr.sa_attr.lvb_size = size;
+			sub->sub_io.u.ci_setattr.sa_avalid =
+						parent->u.ci_setattr.sa_avalid;
+		}
+	}
+
+	return lov_io_start(env, ios);
+}
+
 static void lov_io_fsync_end(const struct lu_env *env,
 			     const struct cl_io_slice *ios)
 {
@@ -1577,7 +1601,7 @@ static void lov_io_lseek_end(const struct lu_env *env,
 			.cio_iter_fini	= lov_io_iter_fini,
 			.cio_lock	= lov_io_lock,
 			.cio_unlock	= lov_io_unlock,
-			.cio_start	= lov_io_start,
+			.cio_start	= lov_io_setattr_start,
 			.cio_end	= lov_io_end
 		},
 		[CIT_DATA_VERSION] = {
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 25/29] lustre: misc: limit CDEBUG console message frequency
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (23 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 24/29] lustre: llite: do fallocate() size checks under lock James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 26/29] lustre: fallocate: Add punch mode to fallocate James Simmons
                   ` (3 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Andreas Dilger <adilger@whamcloud.com>

Some CDEBUG() messages have variable message levels, but if printed
to the console it is not rate limited like CWARN() and CERROR():

server_bulk_callback()) event type 5, status -110
server_bulk_callback()) event type 5, status -110
server_bulk_callback()) event type 5, status -110
:

Instead, use CDEBUG_LIMIT() for those messages to limit them.

WC-bug-id: https://jira.whamcloud.com/browse/LU-930
Lustre-commit: 7462e8cad730897f4 ("LU-930 misc: limit CDEBUG console message frequency")
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/40571
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Wang Shilong <wshilong@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/llite/file.c    |  6 +++---
 fs/lustre/lov/lov_obd.c   | 10 +++++-----
 fs/lustre/ptlrpc/client.c |  8 ++++----
 fs/lustre/ptlrpc/events.c | 16 +++++++---------
 4 files changed, 19 insertions(+), 21 deletions(-)

diff --git a/fs/lustre/llite/file.c b/fs/lustre/llite/file.c
index c049433..15072bb1 100644
--- a/fs/lustre/llite/file.c
+++ b/fs/lustre/llite/file.c
@@ -329,9 +329,9 @@ static int ll_md_close(struct inode *inode, struct file *file)
 		 * application crashed, we need to release here.
 		 */
 		rc = ll_lease_close(fd->fd_lease_och, inode, &lease_broken);
-		CDEBUG(rc ? D_ERROR : D_INODE,
-		       "Clean up lease " DFID " %d/%d\n",
-		       PFID(&lli->lli_fid), rc, lease_broken);
+		CDEBUG_LIMIT(rc ? D_ERROR : D_INODE,
+			     "Clean up lease " DFID " %d/%d\n",
+			     PFID(&lli->lli_fid), rc, lease_broken);
 
 		fd->fd_lease_och = NULL;
 	}
diff --git a/fs/lustre/lov/lov_obd.c b/fs/lustre/lov/lov_obd.c
index 29b0645..20e0be0 100644
--- a/fs/lustre/lov/lov_obd.c
+++ b/fs/lustre/lov/lov_obd.c
@@ -1081,11 +1081,11 @@ static int lov_iocontrol(unsigned int cmd, struct obd_export *exp, int len,
 					    len, karg, uarg);
 			if (err) {
 				if (lov->lov_tgts[i]->ltd_active) {
-					CDEBUG(err == -ENOTTY ?
-					       D_IOCTL : D_WARNING,
-					       "iocontrol OSC %s on OST idx %d cmd %x: err = %d\n",
-					       lov_uuid2str(lov, i),
-					       i, cmd, err);
+					CDEBUG_LIMIT(err == -ENOTTY ?
+						     D_IOCTL : D_WARNING,
+						     "iocontrol OSC %s on OST idx %d cmd %x: err = %d\n",
+						     lov_uuid2str(lov, i),
+						     i, cmd, err);
 					if (!rc)
 						rc = err;
 				}
diff --git a/fs/lustre/ptlrpc/client.c b/fs/lustre/ptlrpc/client.c
index 3c57b69..a818b01 100644
--- a/fs/lustre/ptlrpc/client.c
+++ b/fs/lustre/ptlrpc/client.c
@@ -378,10 +378,10 @@ void ptlrpc_at_adj_net_latency(struct ptlrpc_request *req,
 		 * resent time, but server sent back service time of original
 		 * RPC.
 		 */
-		CDEBUG((lustre_msg_get_flags(req->rq_reqmsg) & MSG_RESENT) ?
-		       D_ADAPTTO : D_WARNING,
-		       "Reported service time %u > total measured time %lld\n",
-		       service_timeout, now - req->rq_sent);
+		CDEBUG_LIMIT((lustre_msg_get_flags(req->rq_reqmsg) &
+			      MSG_RESENT) ?  D_ADAPTTO : D_WARNING,
+			     "Reported service time %u > total measured time %lld\n",
+			     service_timeout, now - req->rq_sent);
 		return;
 	}
 
diff --git a/fs/lustre/ptlrpc/events.c b/fs/lustre/ptlrpc/events.c
index fe33600..e348e4a 100644
--- a/fs/lustre/ptlrpc/events.c
+++ b/fs/lustre/ptlrpc/events.c
@@ -203,9 +203,9 @@ void client_bulk_callback(struct lnet_event *ev)
 				 CFS_FAIL_ONCE))
 		ev->status = -EIO;
 
-	CDEBUG((ev->status == 0) ? D_NET : D_ERROR,
-	       "event type %d, status %d, desc %p\n",
-	       ev->type, ev->status, desc);
+	CDEBUG_LIMIT((ev->status == 0) ? D_NET : D_ERROR,
+		     "event type %d, status %d, desc %p\n",
+		     ev->type, ev->status, desc);
 
 	spin_lock(&desc->bd_lock);
 	req = desc->bd_req;
@@ -311,9 +311,9 @@ void request_in_callback(struct lnet_event *ev)
 	LASSERT((char *)ev->md_start + ev->offset + ev->mlength <=
 		rqbd->rqbd_buffer + service->srv_buf_size);
 
-	CDEBUG((ev->status == 0) ? D_NET : D_ERROR,
-	       "event type %d, status %d, service %s\n",
-	       ev->type, ev->status, service->srv_name);
+	CDEBUG_LIMIT((ev->status == 0) ? D_NET : D_ERROR,
+		     "event type %d, status %d, service %s\n",
+		     ev->type, ev->status, service->srv_name);
 
 	if (ev->unlinked) {
 		/* If this is the last request message to fit in the
@@ -326,10 +326,8 @@ void request_in_callback(struct lnet_event *ev)
 		memset(req, 0, sizeof(*req));
 	} else {
 		LASSERT(ev->type == LNET_EVENT_PUT);
-		if (ev->status != 0) {
-			/* We moaned above already... */
+		if (ev->status != 0) /* We moaned above already... */
 			return;
-		}
 		req = ptlrpc_request_cache_alloc(GFP_ATOMIC);
 		if (!req) {
 			CERROR("Can't allocate incoming request descriptor: Dropping %s RPC from %s\n",
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 26/29] lustre: fallocate: Add punch mode to fallocate
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (24 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 25/29] lustre: misc: limit CDEBUG console message frequency James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 27/29] lustre: various: only use wake_up_all() on exclusive waitqs James Simmons
                   ` (2 subsequent siblings)
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown
  Cc: Arshad Hussain, Mikhail Pershin, Lustre Development List

From: Arshad Hussain <arshad.hussain@aeoncomputing.com>

This patch adds fallocate(2) punch operation
(FALLOCATE_FL_PUNCH_HOLE) mode support for ldiskfs backend
OSD and for OSC/OST

WC-bug-id: https://jira.whamcloud.com/browse/LU-14160
Lustre-commit: cb037f305c64cd512 ("LU-14160 fallocate: Add punch mode to fallocate")
Signed-off-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/40877
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Bobi Jam <bobijam@hotmail.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/include/cl_object.h |  1 -
 fs/lustre/llite/file.c        | 43 ++++++++++++++-------------
 fs/lustre/mdc/mdc_dev.c       |  3 ++
 fs/lustre/osc/osc_io.c        | 68 +++++++++++++++++++++++++------------------
 fs/lustre/osc/osc_request.c   |  7 -----
 5 files changed, 65 insertions(+), 57 deletions(-)

diff --git a/fs/lustre/include/cl_object.h b/fs/lustre/include/cl_object.h
index 3926aac..b69c04a 100644
--- a/fs/lustre/include/cl_object.h
+++ b/fs/lustre/include/cl_object.h
@@ -1876,7 +1876,6 @@ struct cl_io {
 			/* The following are used for fallocate(2) */
 			int			sa_falloc_mode;
 			loff_t			sa_falloc_offset;
-			loff_t			sa_falloc_len;
 			loff_t			sa_falloc_end;
 		} ci_setattr;
 		struct cl_data_version_io {
diff --git a/fs/lustre/llite/file.c b/fs/lustre/llite/file.c
index 15072bb1..c8f250c 100644
--- a/fs/lustre/llite/file.c
+++ b/fs/lustre/llite/file.c
@@ -4998,7 +4998,7 @@ int cl_falloc(struct inode *inode, int mode, loff_t offset, loff_t len)
 	struct lu_env *env;
 	struct cl_io *io;
 	u16 refcheck;
-	int rc; loff_t sa_falloc_end;
+	int rc;
 	loff_t size = i_size_read(inode);
 
 	env = cl_env_get(&refcheck);
@@ -5011,34 +5011,32 @@ int cl_falloc(struct inode *inode, int mode, loff_t offset, loff_t len)
 	io->u.ci_setattr.sa_parent_fid = lu_object_fid(&io->ci_obj->co_lu);
 	io->u.ci_setattr.sa_falloc_mode = mode;
 	io->u.ci_setattr.sa_falloc_offset = offset;
-	io->u.ci_setattr.sa_falloc_len = len;
-	io->u.ci_setattr.sa_falloc_end = io->u.ci_setattr.sa_falloc_offset +
-					 io->u.ci_setattr.sa_falloc_len;
+	io->u.ci_setattr.sa_falloc_end = offset + len;
 	io->u.ci_setattr.sa_subtype = CL_SETATTR_FALLOCATE;
-	sa_falloc_end = io->u.ci_setattr.sa_falloc_end;
-	if (sa_falloc_end > size) {
+	if (io->u.ci_setattr.sa_falloc_end > size) {
+		loff_t newsize = io->u.ci_setattr.sa_falloc_end;
+
 		/* Check new size against VFS/VM file size limit and rlimit */
-		rc = inode_newsize_ok(inode, sa_falloc_end);
+		rc = inode_newsize_ok(inode, newsize);
 		if (rc)
 			goto out;
-		if (sa_falloc_end > ll_file_maxbytes(inode)) {
+		if (newsize > ll_file_maxbytes(inode)) {
 			CDEBUG(D_INODE, "file size too large %llu > %llu\n",
-			       (unsigned long long)(sa_falloc_end),
+			       (unsigned long long)newsize,
 			       ll_file_maxbytes(inode));
 			rc = -EFBIG;
 			goto out;
 		}
 	}
 
-again:
-	if (cl_io_init(env, io, CIT_SETATTR, io->ci_obj) == 0)
-		rc = cl_io_loop(env, io);
-	else
-		rc = io->ci_result;
-
-	cl_io_fini(env, io);
-	if (unlikely(io->ci_need_restart))
-		goto again;
+	do {
+		rc = cl_io_init(env, io, CIT_SETATTR, io->ci_obj);
+		if (rc)
+			rc = io->ci_result;
+		else
+			rc = cl_io_loop(env, io);
+		cl_io_fini(env, io);
+	} while (unlikely(io->ci_need_restart));
 
 out:
 	cl_env_put(env, &refcheck);
@@ -5050,6 +5048,9 @@ long ll_fallocate(struct file *filp, int mode, loff_t offset, loff_t len)
 	struct inode *inode = filp->f_path.dentry->d_inode;
 	int rc;
 
+	if (offset < 0 || len <= 0)
+		return -EINVAL;
+
 	/*
 	 * Encrypted inodes can't handle collapse range or zero range or insert
 	 * range since we would need to re-encrypt blocks with a different IV or
@@ -5062,10 +5063,10 @@ long ll_fallocate(struct file *filp, int mode, loff_t offset, loff_t len)
 		return -EOPNOTSUPP;
 
 	/*
-	 * Only mode == 0 (which is standard prealloc) is supported now.
-	 * Punch is not supported yet.
+	 * mode == 0 (which is standard prealloc) and PUNCH is supported.
+	 * Rest of mode options are not supported yet.
 	 */
-	if (mode & ~FALLOC_FL_KEEP_SIZE)
+	if (mode & ~(FALLOC_FL_KEEP_SIZE | FALLOC_FL_PUNCH_HOLE))
 		return -EOPNOTSUPP;
 
 	ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_FALLOCATE, 1);
diff --git a/fs/lustre/mdc/mdc_dev.c b/fs/lustre/mdc/mdc_dev.c
index 7807f9e..70f8987 100644
--- a/fs/lustre/mdc/mdc_dev.c
+++ b/fs/lustre/mdc/mdc_dev.c
@@ -1046,6 +1046,9 @@ static int mdc_io_setattr_start(const struct lu_env *env,
 			return rc;
 	}
 
+	if (cl_io_is_fallocate(io))
+		return -EOPNOTSUPP;
+
 	if (oio->oi_lockless == 0) {
 		cl_object_attr_lock(obj);
 		rc = cl_object_attr_get(env, obj, attr);
diff --git a/fs/lustre/osc/osc_io.c b/fs/lustre/osc/osc_io.c
index 9d783e0..3be3cfe 100644
--- a/fs/lustre/osc/osc_io.c
+++ b/fs/lustre/osc/osc_io.c
@@ -530,6 +530,29 @@ static void osc_trunc_check(const struct lu_env *env, struct cl_io *io,
 			     trunc_check_cb, (void *)&size);
 }
 
+/**
+ * Flush affected pages prior punch.
+ * We shouldn't discard them locally first because that could be data loss
+ * if server doesn't support fallocate punch, we also need these data to be
+ * flushed first to prevent re-ordering with the punch
+ */
+static int osc_punch_start(const struct lu_env *env, struct cl_io *io,
+			   struct cl_object *obj)
+{
+	struct osc_object *osc = cl2osc(obj);
+	pgoff_t pg_start = cl_index(obj, io->u.ci_setattr.sa_falloc_offset);
+	pgoff_t pg_end = cl_index(obj, io->u.ci_setattr.sa_falloc_end - 1);
+	int rc;
+
+	rc = osc_cache_writeback_range(env, osc, pg_start, pg_end, 1, 0);
+	if (rc < 0)
+		return rc;
+
+	osc_page_gang_lookup(env, io, osc, pg_start, pg_end, osc_discard_cb,
+			     osc);
+	return 0;
+}
+
 static int osc_io_setattr_start(const struct lu_env *env,
 				const struct cl_io_slice *slice)
 {
@@ -543,19 +566,17 @@ static int osc_io_setattr_start(const struct lu_env *env,
 	unsigned int ia_avalid = io->u.ci_setattr.sa_avalid;
 	enum op_xvalid ia_xvalid = io->u.ci_setattr.sa_xvalid;
 	u64 size = io->u.ci_setattr.sa_attr.lvb_size;
-	u64 end = OBD_OBJECT_EOF;
-	bool io_is_falloc = false;
+	bool io_is_falloc = cl_io_is_fallocate(io);
 	int result = 0;
 
 	/* truncate cache dirty pages first */
-	if (cl_io_is_trunc(io)) {
+	if (cl_io_is_trunc(io))
 		result = osc_cache_truncate_start(env, cl2osc(obj), size,
 						  &oio->oi_trunc);
-	} else if (cl_io_is_fallocate(io)) {
-		io_is_falloc = true;
-		size = io->u.ci_setattr.sa_falloc_offset;
-		end = io->u.ci_setattr.sa_falloc_end;
-	}
+	/* flush local pages prior punching them on server */
+	if (io_is_falloc &&
+	    io->u.ci_setattr.sa_falloc_mode & FALLOC_FL_PUNCH_HOLE)
+		result = osc_punch_start(env, io, obj);
 
 	if (result == 0 && oio->oi_lockless == 0) {
 		cl_object_attr_lock(obj);
@@ -565,14 +586,8 @@ static int osc_io_setattr_start(const struct lu_env *env,
 			unsigned int cl_valid = 0;
 
 			if (ia_avalid & ATTR_SIZE) {
-				if (io_is_falloc) {
-					attr->cat_size =
-						io->u.ci_setattr.sa_attr.lvb_size;
-					attr->cat_kms = attr->cat_size;
-				} else {
-					attr->cat_size = size;
-					attr->cat_kms = size;
-				}
+				attr->cat_size = size;
+				attr->cat_kms = size;
 				cl_valid = CAT_SIZE | CAT_KMS;
 			}
 			if (ia_avalid & ATTR_MTIME_SET) {
@@ -612,17 +627,8 @@ static int osc_io_setattr_start(const struct lu_env *env,
 			oa->o_valid |= OBD_MD_FLMTIME;
 			oa->o_mtime = attr->cat_mtime;
 		}
-		if (ia_avalid & ATTR_SIZE) {
-			if (io_is_falloc) {
-				oa->o_size = size;
-				oa->o_blocks = end;
-				oa->o_valid |= OBD_MD_FLSIZE | OBD_MD_FLBLOCKS;
-			} else {
-				oa->o_size = size;
-				oa->o_blocks = OBD_OBJECT_EOF;
-				oa->o_valid |= OBD_MD_FLSIZE | OBD_MD_FLBLOCKS;
-			}
 
+		if (ia_avalid & ATTR_SIZE || io_is_falloc) {
 			if (oio->oi_lockless) {
 				oa->o_flags = OBD_FL_SRVLOCK;
 				oa->o_valid |= OBD_MD_FLFLAGS;
@@ -646,10 +652,16 @@ static int osc_io_setattr_start(const struct lu_env *env,
 		if (io_is_falloc) {
 			int falloc_mode = io->u.ci_setattr.sa_falloc_mode;
 
+			oa->o_size = io->u.ci_setattr.sa_falloc_offset;
+			oa->o_blocks = io->u.ci_setattr.sa_falloc_end;
+			oa->o_valid |= OBD_MD_FLSIZE | OBD_MD_FLBLOCKS;
 			result = osc_fallocate_base(osc_export(cl2osc(obj)),
 						    oa, osc_async_upcall,
 						    cbargs, falloc_mode);
 		} else if (ia_avalid & ATTR_SIZE) {
+			oa->o_size = size;
+			oa->o_blocks = OBD_OBJECT_EOF;
+			oa->o_valid |= OBD_MD_FLSIZE | OBD_MD_FLBLOCKS;
 			result = osc_punch_send(osc_export(cl2osc(obj)),
 						oa, osc_async_upcall, cbargs);
 		} else {
@@ -682,11 +694,11 @@ void osc_io_setattr_end(const struct lu_env *env,
 	if (result == 0) {
 		if (oio->oi_lockless) {
 			/* lockless truncate */
-			struct osc_device *osd = lu2osc_dev(obj->co_lu.lo_dev);
+			struct osc_device *osc = lu2osc_dev(obj->co_lu.lo_dev);
 
 			LASSERT(cl_io_is_trunc(io) || cl_io_is_fallocate(io));
 			/* XXX: Need a lock. */
-			osd->od_stats.os_lockless_truncates++;
+			osc->od_stats.os_lockless_truncates++;
 		}
 	}
 
diff --git a/fs/lustre/osc/osc_request.c b/fs/lustre/osc/osc_request.c
index 973c504..376afb9 100644
--- a/fs/lustre/osc/osc_request.c
+++ b/fs/lustre/osc/osc_request.c
@@ -454,14 +454,7 @@ int osc_fallocate_base(struct obd_export *exp, struct obdo *oa,
 	struct obd_import *imp = class_exp2cliimp(exp);
 	int rc;
 
-	/*
-	 * Only mode == 0 (which is standard prealloc) is supported now.
-	 * Punch is not supported yet.
-	 */
-	if (mode & ~FALLOC_FL_KEEP_SIZE)
-		return -EOPNOTSUPP;
 	oa->o_falloc_mode = mode;
-
 	req = ptlrpc_request_alloc(class_exp2cliimp(exp),
 				   &RQF_OST_FALLOCATE);
 	if (!req)
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 27/29] lustre: various: only use wake_up_all() on exclusive waitqs
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (25 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 26/29] lustre: fallocate: Add punch mode to fallocate James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 28/29] lnet: remove references to Sun Trademark James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 29/29] lustre: " James Simmons
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Mr NeilBrown <neilb@suse.de>

wake_up_all() is not necessary of wait_queues which are not the
subject of an exclusive waiter.  When all waiters are non-exclusive,
wake_up() will wake them all up.

Use of wake_up_all() suggests to the reader that the queue is subject
to exclusive waits.  When that is not the case, the usage can cause
confusion.

So change all wake_up_all() on non-exclusive waitqueues to wake_up().

The only wait_queues on which exclusive waits are requested are:
ws_waitq         ibs_waitq        kss_waitq         ksnd_connd_waitq
blp_waitq        imp_replay_waitq cl_mod_rpcs_waitq cl_cache_waiters
cl_destroy_waitq scp_waitq

All others now only use wake_up().

WC-bug-id: https://jira.whamcloud.com/browse/LU-14352
Lustre-commit: 1f4e9f0f4f483dc9 ("LU-14352 various: only use wake_up_all() on exclusive waitqs")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/41289
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Yang Sheng <ys@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/ldlm/ldlm_lock.c       | 6 +++---
 fs/lustre/llite/pcc.c            | 2 +-
 fs/lustre/lov/lov_io.c           | 4 ++--
 fs/lustre/mdc/mdc_changelog.c    | 8 ++++----
 fs/lustre/obdclass/cl_io.c       | 2 +-
 fs/lustre/obdclass/lu_object.c   | 2 +-
 fs/lustre/osc/osc_io.c           | 2 +-
 fs/lustre/osc/osc_page.c         | 6 +++---
 fs/lustre/ptlrpc/sec_bulk.c      | 2 +-
 fs/lustre/ptlrpc/service.c       | 2 +-
 net/lnet/klnds/o2iblnd/o2iblnd.c | 4 ++--
 net/lnet/klnds/socklnd/socklnd.c | 4 ++--
 net/lnet/lnet/peer.c             | 2 +-
 13 files changed, 23 insertions(+), 23 deletions(-)

diff --git a/fs/lustre/ldlm/ldlm_lock.c b/fs/lustre/ldlm/ldlm_lock.c
index c872455..8201e28 100644
--- a/fs/lustre/ldlm/ldlm_lock.c
+++ b/fs/lustre/ldlm/ldlm_lock.c
@@ -1217,7 +1217,7 @@ void ldlm_lock_fail_match_locked(struct ldlm_lock *lock)
 {
 	if ((lock->l_flags & LDLM_FL_FAIL_NOTIFIED) == 0) {
 		lock->l_flags |= LDLM_FL_FAIL_NOTIFIED;
-		wake_up_all(&lock->l_waitq);
+		wake_up(&lock->l_waitq);
 	}
 }
 
@@ -1231,7 +1231,7 @@ void ldlm_lock_fail_match_locked(struct ldlm_lock *lock)
 void ldlm_lock_allow_match_locked(struct ldlm_lock *lock)
 {
 	ldlm_set_lvb_ready(lock);
-	wake_up_all(&lock->l_waitq);
+	wake_up(&lock->l_waitq);
 }
 EXPORT_SYMBOL(ldlm_lock_allow_match_locked);
 
@@ -1752,7 +1752,7 @@ void ldlm_cancel_callback(struct ldlm_lock *lock)
 		}
 		/* only canceller can set bl_done bit */
 		ldlm_set_bl_done(lock);
-		wake_up_all(&lock->l_waitq);
+		wake_up(&lock->l_waitq);
 	} else if (!ldlm_is_bl_done(lock)) {
 		/*
 		 * The lock is guaranteed to have been canceled once
diff --git a/fs/lustre/llite/pcc.c b/fs/lustre/llite/pcc.c
index 297189c9..b259fa5 100644
--- a/fs/lustre/llite/pcc.c
+++ b/fs/lustre/llite/pcc.c
@@ -1566,7 +1566,7 @@ static void pcc_io_fini(struct inode *inode)
 
 	LASSERT(pcci && atomic_read(&pcci->pcci_active_ios) > 0);
 	if (atomic_dec_and_test(&pcci->pcci_active_ios))
-		wake_up_all(&pcci->pcci_waitq);
+		wake_up(&pcci->pcci_waitq);
 }
 
 ssize_t pcc_file_read_iter(struct kiocb *iocb,
diff --git a/fs/lustre/lov/lov_io.c b/fs/lustre/lov/lov_io.c
index 7da0047..1d5ea41 100644
--- a/fs/lustre/lov/lov_io.c
+++ b/fs/lustre/lov/lov_io.c
@@ -651,7 +651,7 @@ static void lov_io_fini(const struct lu_env *env, const struct cl_io_slice *ios)
 
 	LASSERT(atomic_read(&lov->lo_active_ios) > 0);
 	if (atomic_dec_and_test(&lov->lo_active_ios))
-		wake_up_all(&lov->lo_waitq);
+		wake_up(&lov->lo_waitq);
 }
 
 static void lov_io_sub_inherit(struct lov_io_sub *sub, struct lov_io *lio,
@@ -1674,7 +1674,7 @@ static void lov_empty_io_fini(const struct lu_env *env,
 	struct lov_object *lov = cl2lov(ios->cis_obj);
 
 	if (atomic_dec_and_test(&lov->lo_active_ios))
-		wake_up_all(&lov->lo_waitq);
+		wake_up(&lov->lo_waitq);
 }
 
 static int lov_empty_io_submit(const struct lu_env *env,
diff --git a/fs/lustre/mdc/mdc_changelog.c b/fs/lustre/mdc/mdc_changelog.c
index f671f465..ef6d4f9 100644
--- a/fs/lustre/mdc/mdc_changelog.c
+++ b/fs/lustre/mdc/mdc_changelog.c
@@ -256,7 +256,7 @@ static int chlg_read_cat_process_cb(const struct lu_env *env,
 	crs->crs_rec_count++;
 	mutex_unlock(&crs->crs_lock);
 
-	wake_up_all(&crs->crs_waitq_cons);
+	wake_up(&crs->crs_waitq_cons);
 
 	return 0;
 }
@@ -347,7 +347,7 @@ static int chlg_load(void *args)
 	if (rc < 0)
 		crs->crs_err = rc;
 
-	wake_up_all(&crs->crs_waitq_cons);
+	wake_up(&crs->crs_waitq_cons);
 
 	if (llh)
 		llog_cat_close(NULL, llh);
@@ -420,7 +420,7 @@ static ssize_t chlg_read(struct file *file, char __user *buff, size_t count,
 
 	if (written_total > 0) {
 		rc = written_total;
-		wake_up_all(&crs->crs_waitq_prod);
+		wake_up(&crs->crs_waitq_prod);
 	} else if (rc == 0) {
 		rc = crs->crs_err;
 	}
@@ -464,7 +464,7 @@ static int chlg_set_start_offset(struct chlg_reader_state *crs, u64 offset)
 	}
 
 	mutex_unlock(&crs->crs_lock);
-	wake_up_all(&crs->crs_waitq_prod);
+	wake_up(&crs->crs_waitq_prod);
 	return 0;
 }
 
diff --git a/fs/lustre/obdclass/cl_io.c b/fs/lustre/obdclass/cl_io.c
index 27804d3..ca4d387 100644
--- a/fs/lustre/obdclass/cl_io.c
+++ b/fs/lustre/obdclass/cl_io.c
@@ -1187,7 +1187,7 @@ void cl_sync_io_note(const struct lu_env *env, struct cl_sync_io *anchor,
 		 * the wakeup ensures cl_sync_io_wait() doesn't complete
 		 * before the wakeup completes.
 		 */
-		wake_up_all_locked(&anchor->csi_waitq);
+		wake_up_locked(&anchor->csi_waitq);
 		if (end_io)
 			end_io(env, anchor);
 		if (anchor->csi_aio)
diff --git a/fs/lustre/obdclass/lu_object.c b/fs/lustre/obdclass/lu_object.c
index fcf0739..419cb74 100644
--- a/fs/lustre/obdclass/lu_object.c
+++ b/fs/lustre/obdclass/lu_object.c
@@ -398,7 +398,7 @@ static void lu_object_free(const struct lu_env *env, struct lu_object *o)
 	}
 
 	if (waitqueue_active(wq))
-		wake_up_all(wq);
+		wake_up(wq);
 }
 
 /**
diff --git a/fs/lustre/osc/osc_io.c b/fs/lustre/osc/osc_io.c
index 3be3cfe..ce64cf8 100644
--- a/fs/lustre/osc/osc_io.c
+++ b/fs/lustre/osc/osc_io.c
@@ -437,7 +437,7 @@ void osc_io_iter_fini(const struct lu_env *env,
 		oio->oi_is_active = 0;
 		LASSERT(atomic_read(&osc->oo_nr_ios) > 0);
 		if (atomic_dec_and_test(&osc->oo_nr_ios))
-			wake_up_all(&osc->oo_io_waitq);
+			wake_up(&osc->oo_io_waitq);
 	}
 }
 EXPORT_SYMBOL(osc_io_iter_fini);
diff --git a/fs/lustre/osc/osc_page.c b/fs/lustre/osc/osc_page.c
index c59a5ac..8b25329a 100644
--- a/fs/lustre/osc/osc_page.c
+++ b/fs/lustre/osc/osc_page.c
@@ -679,7 +679,7 @@ long osc_lru_shrink(const struct lu_env *env, struct client_obd *cli,
 	atomic_dec(&cli->cl_lru_shrinkers);
 	if (count > 0) {
 		atomic_long_add(count, cli->cl_lru_left);
-		wake_up_all(&osc_lru_waitq);
+		wake_up(&osc_lru_waitq);
 	}
 	return count > 0 ? count : rc;
 }
@@ -890,7 +890,7 @@ unsigned long osc_lru_reserve(struct client_obd *cli, unsigned long npages)
 void osc_lru_unreserve(struct client_obd *cli, unsigned long npages)
 {
 	atomic_long_add(npages, cli->cl_lru_left);
-	wake_up_all(&osc_lru_waitq);
+	wake_up(&osc_lru_waitq);
 }
 
 /**
@@ -987,7 +987,7 @@ void osc_dec_unstable_pages(struct ptlrpc_request *req)
 						&cli->cl_cache->ccc_unstable_nr);
 	LASSERT(unstable_count >= 0);
 	if (!unstable_count)
-		wake_up_all(&cli->cl_cache->ccc_unstable_waitq);
+		wake_up(&cli->cl_cache->ccc_unstable_waitq);
 
 	if (waitqueue_active(&osc_lru_waitq))
 		(void)ptlrpcd_queue_work(cli->cl_lru_work);
diff --git a/fs/lustre/ptlrpc/sec_bulk.c b/fs/lustre/ptlrpc/sec_bulk.c
index 9548721..ef127b8 100644
--- a/fs/lustre/ptlrpc/sec_bulk.c
+++ b/fs/lustre/ptlrpc/sec_bulk.c
@@ -304,7 +304,7 @@ static inline void enc_pools_wakeup(void)
 
 	if (unlikely(page_pools.epp_waitqlen)) {
 		LASSERT(waitqueue_active(&page_pools.epp_waitq));
-		wake_up_all(&page_pools.epp_waitq);
+		wake_up(&page_pools.epp_waitq);
 	}
 }
 
diff --git a/fs/lustre/ptlrpc/service.c b/fs/lustre/ptlrpc/service.c
index 070eecc..1057892 100644
--- a/fs/lustre/ptlrpc/service.c
+++ b/fs/lustre/ptlrpc/service.c
@@ -2465,7 +2465,7 @@ static void ptlrpc_stop_hr_threads(void)
 		if (!hrp->hrp_thrs)
 			continue; /* uninitialized */
 		for (j = 0; j < hrp->hrp_nthrs; j++)
-			wake_up_all(&hrp->hrp_thrs[j].hrt_waitq);
+			wake_up(&hrp->hrp_thrs[j].hrt_waitq);
 	}
 
 	cfs_percpt_for_each(hrp, i, ptlrpc_hr.hr_partitions) {
diff --git a/net/lnet/klnds/o2iblnd/o2iblnd.c b/net/lnet/klnds/o2iblnd/o2iblnd.c
index 782e29b..0c43969 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/net/lnet/klnds/o2iblnd/o2iblnd.c
@@ -2520,8 +2520,8 @@ static void kiblnd_base_shutdown(void)
 		cfs_percpt_for_each(sched, i, kiblnd_data.kib_scheds)
 			wake_up_all(&sched->ibs_waitq);
 
-		wake_up_all(&kiblnd_data.kib_connd_waitq);
-		wake_up_all(&kiblnd_data.kib_failover_waitq);
+		wake_up(&kiblnd_data.kib_connd_waitq);
+		wake_up(&kiblnd_data.kib_failover_waitq);
 
 		wait_var_event_warning(&kiblnd_data.kib_nthreads,
 				       !atomic_read(&kiblnd_data.kib_nthreads),
diff --git a/net/lnet/klnds/socklnd/socklnd.c b/net/lnet/klnds/socklnd/socklnd.c
index 141da88..54c5e2c 100644
--- a/net/lnet/klnds/socklnd/socklnd.c
+++ b/net/lnet/klnds/socklnd/socklnd.c
@@ -1799,12 +1799,12 @@ static int ksocknal_push(struct lnet_ni *ni, struct lnet_process_id id)
 		/* flag threads to terminate; wake and wait for them to die */
 		ksocknal_data.ksnd_shuttingdown = 1;
 		wake_up_all(&ksocknal_data.ksnd_connd_waitq);
-		wake_up_all(&ksocknal_data.ksnd_reaper_waitq);
+		wake_up(&ksocknal_data.ksnd_reaper_waitq);
 
 		if (ksocknal_data.ksnd_schedulers) {
 			cfs_percpt_for_each(sched, i,
 					    ksocknal_data.ksnd_schedulers)
-					wake_up_all(&sched->kss_waitq);
+					    wake_up_all(&sched->kss_waitq);
 		}
 
 		wait_var_event_warning(&ksocknal_data.ksnd_nthreads,
diff --git a/net/lnet/lnet/peer.c b/net/lnet/lnet/peer.c
index c833e34..36e52df 100644
--- a/net/lnet/lnet/peer.c
+++ b/net/lnet/lnet/peer.c
@@ -2131,7 +2131,7 @@ static void lnet_peer_discovery_complete(struct lnet_peer *lp)
 	spin_lock(&lp->lp_lock);
 	list_splice_init(&lp->lp_dc_pendq, &pending_msgs);
 	spin_unlock(&lp->lp_lock);
-	wake_up_all(&lp->lp_dc_waitq);
+	wake_up(&lp->lp_dc_waitq);
 
 	if (lp->lp_rtr_refcount > 0)
 		lnet_router_discovery_complete(lp);
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 28/29] lnet: remove references to Sun Trademark.
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (26 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 27/29] lustre: various: only use wake_up_all() on exclusive waitqs James Simmons
@ 2021-04-25 20:08 ` James Simmons
  2021-04-25 20:08 ` [lustre-devel] [PATCH 29/29] lustre: " James Simmons
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Mr NeilBrown <neilb@suse.de>

"lustre" is no longer a Trademark of Sun Microsystems.  There is no
need to acknowledge the trademark in every file, so just remove all
these claims.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14487
Lustre-commit: b77281bfd01367d2 ("LU-14487 lnet: remove references to Sun Trademark.")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/42138
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 include/uapi/linux/lnet/libcfs_debug.h     | 1 -
 include/uapi/linux/lnet/libcfs_ioctl.h     | 1 -
 include/uapi/linux/lnet/lnet-idl.h         | 1 -
 include/uapi/linux/lnet/socklnd.h          | 1 -
 net/lnet/klnds/o2iblnd/o2iblnd-idl.h       | 1 -
 net/lnet/klnds/o2iblnd/o2iblnd.c           | 1 -
 net/lnet/klnds/o2iblnd/o2iblnd.h           | 1 -
 net/lnet/klnds/o2iblnd/o2iblnd_cb.c        | 1 -
 net/lnet/klnds/o2iblnd/o2iblnd_modparams.c | 1 -
 net/lnet/klnds/socklnd/socklnd.c           | 1 -
 net/lnet/klnds/socklnd/socklnd_lib.c       | 1 -
 net/lnet/lnet/acceptor.c                   | 1 -
 net/lnet/lnet/api-ni.c                     | 1 -
 net/lnet/lnet/config.c                     | 1 -
 net/lnet/lnet/lib-md.c                     | 1 -
 net/lnet/lnet/lib-me.c                     | 1 -
 net/lnet/lnet/lib-move.c                   | 1 -
 net/lnet/lnet/lib-msg.c                    | 1 -
 net/lnet/lnet/lib-ptl.c                    | 1 -
 net/lnet/lnet/lo.c                         | 1 -
 net/lnet/lnet/module.c                     | 1 -
 net/lnet/lnet/nidstrings.c                 | 1 -
 net/lnet/lnet/peer.c                       | 1 -
 net/lnet/selftest/brw_test.c               | 1 -
 net/lnet/selftest/conctl.c                 | 1 -
 net/lnet/selftest/conrpc.c                 | 1 -
 net/lnet/selftest/conrpc.h                 | 1 -
 net/lnet/selftest/console.c                | 1 -
 net/lnet/selftest/console.h                | 1 -
 net/lnet/selftest/framework.c              | 1 -
 net/lnet/selftest/module.c                 | 1 -
 net/lnet/selftest/ping_test.c              | 1 -
 net/lnet/selftest/rpc.c                    | 1 -
 net/lnet/selftest/rpc.h                    | 1 -
 net/lnet/selftest/selftest.h               | 1 -
 net/lnet/selftest/timer.c                  | 1 -
 net/lnet/selftest/timer.h                  | 1 -
 37 files changed, 37 deletions(-)

diff --git a/include/uapi/linux/lnet/libcfs_debug.h b/include/uapi/linux/lnet/libcfs_debug.h
index b720e06..6b64f0e 100644
--- a/include/uapi/linux/lnet/libcfs_debug.h
+++ b/include/uapi/linux/lnet/libcfs_debug.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * libcfs/include/libcfs/libcfs_debug.h
  *
diff --git a/include/uapi/linux/lnet/libcfs_ioctl.h b/include/uapi/linux/lnet/libcfs_ioctl.h
index 5a46a48..2c900ef 100644
--- a/include/uapi/linux/lnet/libcfs_ioctl.h
+++ b/include/uapi/linux/lnet/libcfs_ioctl.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * libcfs/include/libcfs/libcfs_ioctl.h
  *
diff --git a/include/uapi/linux/lnet/lnet-idl.h b/include/uapi/linux/lnet/lnet-idl.h
index a5b1414..1e27f3b 100644
--- a/include/uapi/linux/lnet/lnet-idl.h
+++ b/include/uapi/linux/lnet/lnet-idl.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef __UAPI_LNET_IDL_H__
diff --git a/include/uapi/linux/lnet/socklnd.h b/include/uapi/linux/lnet/socklnd.h
index 50f2a13..b5b7493 100644
--- a/include/uapi/linux/lnet/socklnd.h
+++ b/include/uapi/linux/lnet/socklnd.h
@@ -26,7 +26,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * #defines shared between socknal implementation and utilities
  */
diff --git a/net/lnet/klnds/o2iblnd/o2iblnd-idl.h b/net/lnet/klnds/o2iblnd/o2iblnd-idl.h
index 660440c..f8972d1 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd-idl.h
+++ b/net/lnet/klnds/o2iblnd/o2iblnd-idl.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/klnds/o2iblnd/o2iblnd-idl.h
  *
diff --git a/net/lnet/klnds/o2iblnd/o2iblnd.c b/net/lnet/klnds/o2iblnd/o2iblnd.c
index 0c43969..d670180 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd.c
+++ b/net/lnet/klnds/o2iblnd/o2iblnd.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/klnds/o2iblnd/o2iblnd.c
  *
diff --git a/net/lnet/klnds/o2iblnd/o2iblnd.h b/net/lnet/klnds/o2iblnd/o2iblnd.h
index c578673..824b204 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd.h
+++ b/net/lnet/klnds/o2iblnd/o2iblnd.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/klnds/o2iblnd/o2iblnd.h
  *
diff --git a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
index de3b42e..ec0d05a 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
+++ b/net/lnet/klnds/o2iblnd/o2iblnd_cb.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/klnds/o2iblnd/o2iblnd_cb.c
  *
diff --git a/net/lnet/klnds/o2iblnd/o2iblnd_modparams.c b/net/lnet/klnds/o2iblnd/o2iblnd_modparams.c
index 029c9fb..81cde1b 100644
--- a/net/lnet/klnds/o2iblnd/o2iblnd_modparams.c
+++ b/net/lnet/klnds/o2iblnd/o2iblnd_modparams.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/klnds/o2iblnd/o2iblnd_modparams.c
  *
diff --git a/net/lnet/klnds/socklnd/socklnd.c b/net/lnet/klnds/socklnd/socklnd.c
index 54c5e2c..4c79d1a 100644
--- a/net/lnet/klnds/socklnd/socklnd.c
+++ b/net/lnet/klnds/socklnd/socklnd.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/klnds/socklnd/socklnd.c
  *
diff --git a/net/lnet/klnds/socklnd/socklnd_lib.c b/net/lnet/klnds/socklnd/socklnd_lib.c
index 6ce5ca4..78e58f6 100644
--- a/net/lnet/klnds/socklnd/socklnd_lib.c
+++ b/net/lnet/klnds/socklnd/socklnd_lib.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #include <linux/highmem.h>
diff --git a/net/lnet/lnet/acceptor.c b/net/lnet/lnet/acceptor.c
index d326e39..b301ffa 100644
--- a/net/lnet/lnet/acceptor.c
+++ b/net/lnet/lnet/acceptor.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LNET
diff --git a/net/lnet/lnet/api-ni.c b/net/lnet/lnet/api-ni.c
index 27640c7..cc40040 100644
--- a/net/lnet/lnet/api-ni.c
+++ b/net/lnet/lnet/api-ni.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LNET
diff --git a/net/lnet/lnet/config.c b/net/lnet/lnet/config.c
index ee68c63..5f4b90b 100644
--- a/net/lnet/lnet/config.c
+++ b/net/lnet/lnet/config.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LNET
diff --git a/net/lnet/lnet/lib-md.c b/net/lnet/lnet/lib-md.c
index b3f758c..fbee4e0 100644
--- a/net/lnet/lnet/lib-md.c
+++ b/net/lnet/lnet/lib-md.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/lnet/lib-md.c
  *
diff --git a/net/lnet/lnet/lib-me.c b/net/lnet/lnet/lib-me.c
index f75f3cb1..66a79e2 100644
--- a/net/lnet/lnet/lib-me.c
+++ b/net/lnet/lnet/lib-me.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/lnet/lib-me.c
  *
diff --git a/net/lnet/lnet/lib-move.c b/net/lnet/lnet/lib-move.c
index a9399cc..896ab12 100644
--- a/net/lnet/lnet/lib-move.c
+++ b/net/lnet/lnet/lib-move.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/lnet/lib-move.c
  *
diff --git a/net/lnet/lnet/lib-msg.c b/net/lnet/lnet/lib-msg.c
index 0a4a317..3f6cd1d 100644
--- a/net/lnet/lnet/lib-msg.c
+++ b/net/lnet/lnet/lib-msg.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/lnet/lib-msg.c
  *
diff --git a/net/lnet/lnet/lib-ptl.c b/net/lnet/lnet/lib-ptl.c
index 45d1be2..095b190 100644
--- a/net/lnet/lnet/lib-ptl.c
+++ b/net/lnet/lnet/lib-ptl.c
@@ -21,7 +21,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/lnet/lib-ptl.c
  *
diff --git a/net/lnet/lnet/lo.c b/net/lnet/lnet/lo.c
index 58b0ee9..4ddf1cd 100644
--- a/net/lnet/lnet/lo.c
+++ b/net/lnet/lnet/lo.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LNET
diff --git a/net/lnet/lnet/module.c b/net/lnet/lnet/module.c
index 939c255..aba9589 100644
--- a/net/lnet/lnet/module.c
+++ b/net/lnet/lnet/module.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LNET
diff --git a/net/lnet/lnet/nidstrings.c b/net/lnet/lnet/nidstrings.c
index cce2ae4..209da0f 100644
--- a/net/lnet/lnet/nidstrings.c
+++ b/net/lnet/lnet/nidstrings.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/lnet/nidstrings.c
  *
diff --git a/net/lnet/lnet/peer.c b/net/lnet/lnet/peer.c
index 36e52df..0ec1460 100644
--- a/net/lnet/lnet/peer.c
+++ b/net/lnet/lnet/peer.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/lnet/peer.c
  */
diff --git a/net/lnet/selftest/brw_test.c b/net/lnet/selftest/brw_test.c
index 560bcc7..87ad765 100644
--- a/net/lnet/selftest/brw_test.c
+++ b/net/lnet/selftest/brw_test.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/selftest/brw_test.c
  *
diff --git a/net/lnet/selftest/conctl.c b/net/lnet/selftest/conctl.c
index 7e82304..b6dc4ee 100644
--- a/net/lnet/selftest/conctl.c
+++ b/net/lnet/selftest/conctl.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/selftest/conctl.c
  *
diff --git a/net/lnet/selftest/conrpc.c b/net/lnet/selftest/conrpc.c
index 6a55b23..0170219 100644
--- a/net/lnet/selftest/conrpc.c
+++ b/net/lnet/selftest/conrpc.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/selftest/conctl.c
  *
diff --git a/net/lnet/selftest/conrpc.h b/net/lnet/selftest/conrpc.h
index 180fa02..203576f 100644
--- a/net/lnet/selftest/conrpc.h
+++ b/net/lnet/selftest/conrpc.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * /lnet/selftest/conrpc.h
  *
diff --git a/net/lnet/selftest/console.c b/net/lnet/selftest/console.c
index cc2c61d..38b169f 100644
--- a/net/lnet/selftest/console.c
+++ b/net/lnet/selftest/console.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/selftest/conctl.c
  *
diff --git a/net/lnet/selftest/console.h b/net/lnet/selftest/console.h
index cd132e1..93aa515 100644
--- a/net/lnet/selftest/console.h
+++ b/net/lnet/selftest/console.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/selftest/console.h
  *
diff --git a/net/lnet/selftest/framework.c b/net/lnet/selftest/framework.c
index 00e7363..e84904e 100644
--- a/net/lnet/selftest/framework.c
+++ b/net/lnet/selftest/framework.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/selftest/framework.c
  *
diff --git a/net/lnet/selftest/module.c b/net/lnet/selftest/module.c
index 2de2b59..f6a3ec2 100644
--- a/net/lnet/selftest/module.c
+++ b/net/lnet/selftest/module.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LNET
diff --git a/net/lnet/selftest/ping_test.c b/net/lnet/selftest/ping_test.c
index f54bd63..a0563a3 100644
--- a/net/lnet/selftest/ping_test.c
+++ b/net/lnet/selftest/ping_test.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/selftest/conctl.c
  *
diff --git a/net/lnet/selftest/rpc.c b/net/lnet/selftest/rpc.c
index d012930..7141da4 100644
--- a/net/lnet/selftest/rpc.c
+++ b/net/lnet/selftest/rpc.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/selftest/rpc.c
  *
diff --git a/net/lnet/selftest/rpc.h b/net/lnet/selftest/rpc.h
index 6d07452..2a5e317 100644
--- a/net/lnet/selftest/rpc.h
+++ b/net/lnet/selftest/rpc.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef __SELFTEST_RPC_H__
diff --git a/net/lnet/selftest/selftest.h b/net/lnet/selftest/selftest.h
index 0fe8c4f..26202c1 100644
--- a/net/lnet/selftest/selftest.h
+++ b/net/lnet/selftest/selftest.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/selftest/selftest.h
  *
diff --git a/net/lnet/selftest/timer.c b/net/lnet/selftest/timer.c
index 51ff979..ee82f87 100644
--- a/net/lnet/selftest/timer.c
+++ b/net/lnet/selftest/timer.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/selftest/timer.c
  *
diff --git a/net/lnet/selftest/timer.h b/net/lnet/selftest/timer.h
index 7f0ef9b..3abedb9 100644
--- a/net/lnet/selftest/timer.h
+++ b/net/lnet/selftest/timer.h
@@ -26,7 +26,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lnet/selftest/timer.h
  *
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

* [lustre-devel] [PATCH 29/29] lustre: remove references to Sun Trademark.
  2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
                   ` (27 preceding siblings ...)
  2021-04-25 20:08 ` [lustre-devel] [PATCH 28/29] lnet: remove references to Sun Trademark James Simmons
@ 2021-04-25 20:08 ` James Simmons
  28 siblings, 0 replies; 30+ messages in thread
From: James Simmons @ 2021-04-25 20:08 UTC (permalink / raw)
  To: Andreas Dilger, Oleg Drokin, NeilBrown; +Cc: Lustre Development List

From: Mr NeilBrown <neilb@suse.de>

"lustre" is no longer a Trademark of Sun Microsystems.  There is no
need to acknowledge the trademark in every file, so just remove all
these claims.

WC-bug-id: https://jira.whamcloud.com/browse/LU-14487
Lustre-commit: 83ddd179225821e5 ("LU-14487 modules: remove references to Sun Trademark.")
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Reviewed-on: https://review.whamcloud.com/42139
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 fs/lustre/fid/fid_internal.h          | 1 -
 fs/lustre/fid/fid_lib.c               | 1 -
 fs/lustre/fid/fid_request.c           | 1 -
 fs/lustre/fid/lproc_fid.c             | 1 -
 fs/lustre/fld/fld_cache.c             | 1 -
 fs/lustre/fld/fld_internal.h          | 1 -
 fs/lustre/fld/fld_request.c           | 1 -
 fs/lustre/fld/lproc_fld.c             | 1 -
 fs/lustre/ldlm/l_lock.c               | 1 -
 fs/lustre/ldlm/ldlm_extent.c          | 1 -
 fs/lustre/ldlm/ldlm_flock.c           | 1 -
 fs/lustre/ldlm/ldlm_inodebits.c       | 1 -
 fs/lustre/ldlm/ldlm_internal.h        | 1 -
 fs/lustre/ldlm/ldlm_lib.c             | 1 -
 fs/lustre/ldlm/ldlm_lock.c            | 1 -
 fs/lustre/ldlm/ldlm_lockd.c           | 1 -
 fs/lustre/ldlm/ldlm_plain.c           | 1 -
 fs/lustre/ldlm/ldlm_pool.c            | 1 -
 fs/lustre/ldlm/ldlm_request.c         | 1 -
 fs/lustre/ldlm/ldlm_resource.c        | 1 -
 fs/lustre/llite/acl.c                 | 1 -
 fs/lustre/llite/dcache.c              | 1 -
 fs/lustre/llite/dir.c                 | 1 -
 fs/lustre/llite/file.c                | 1 -
 fs/lustre/llite/glimpse.c             | 1 -
 fs/lustre/llite/lcommon_cl.c          | 1 -
 fs/lustre/llite/lcommon_misc.c        | 1 -
 fs/lustre/llite/llite_internal.h      | 1 -
 fs/lustre/llite/llite_lib.c           | 1 -
 fs/lustre/llite/llite_mmap.c          | 1 -
 fs/lustre/llite/llite_nfs.c           | 1 -
 fs/lustre/llite/lproc_llite.c         | 1 -
 fs/lustre/llite/namei.c               | 1 -
 fs/lustre/llite/rw.c                  | 1 -
 fs/lustre/llite/rw26.c                | 1 -
 fs/lustre/llite/statahead.c           | 1 -
 fs/lustre/llite/super25.c             | 1 -
 fs/lustre/llite/symlink.c             | 1 -
 fs/lustre/llite/vvp_dev.c             | 1 -
 fs/lustre/llite/vvp_internal.h        | 1 -
 fs/lustre/llite/vvp_io.c              | 1 -
 fs/lustre/llite/vvp_object.c          | 1 -
 fs/lustre/llite/vvp_page.c            | 1 -
 fs/lustre/llite/xattr.c               | 1 -
 fs/lustre/lmv/lmv_fld.c               | 1 -
 fs/lustre/lmv/lmv_intent.c            | 1 -
 fs/lustre/lmv/lmv_internal.h          | 1 -
 fs/lustre/lmv/lmv_obd.c               | 1 -
 fs/lustre/lmv/lproc_lmv.c             | 1 -
 fs/lustre/lov/lov_cl_internal.h       | 2 --
 fs/lustre/lov/lov_dev.c               | 1 -
 fs/lustre/lov/lov_ea.c                | 1 -
 fs/lustre/lov/lov_internal.h          | 1 -
 fs/lustre/lov/lov_io.c                | 1 -
 fs/lustre/lov/lov_lock.c              | 1 -
 fs/lustre/lov/lov_merge.c             | 1 -
 fs/lustre/lov/lov_obd.c               | 1 -
 fs/lustre/lov/lov_object.c            | 1 -
 fs/lustre/lov/lov_offset.c            | 1 -
 fs/lustre/lov/lov_pack.c              | 1 -
 fs/lustre/lov/lov_page.c              | 1 -
 fs/lustre/lov/lov_pool.c              | 1 -
 fs/lustre/lov/lov_request.c           | 1 -
 fs/lustre/lov/lovsub_dev.c            | 1 -
 fs/lustre/lov/lovsub_object.c         | 1 -
 fs/lustre/lov/lproc_lov.c             | 1 -
 fs/lustre/mdc/lproc_mdc.c             | 1 -
 fs/lustre/mdc/mdc_internal.h          | 1 -
 fs/lustre/mdc/mdc_lib.c               | 1 -
 fs/lustre/mdc/mdc_locks.c             | 1 -
 fs/lustre/mdc/mdc_reint.c             | 1 -
 fs/lustre/mdc/mdc_request.c           | 1 -
 fs/lustre/mgc/lproc_mgc.c             | 1 -
 fs/lustre/mgc/mgc_internal.h          | 1 -
 fs/lustre/mgc/mgc_request.c           | 1 -
 fs/lustre/obdclass/cl_internal.h      | 1 -
 fs/lustre/obdclass/cl_io.c            | 1 -
 fs/lustre/obdclass/cl_lock.c          | 1 -
 fs/lustre/obdclass/cl_object.c        | 1 -
 fs/lustre/obdclass/cl_page.c          | 1 -
 fs/lustre/obdclass/class_obd.c        | 1 -
 fs/lustre/obdclass/genops.c           | 1 -
 fs/lustre/obdclass/kernelcomm.c       | 1 -
 fs/lustre/obdclass/llog.c             | 1 -
 fs/lustre/obdclass/llog_cat.c         | 1 -
 fs/lustre/obdclass/llog_internal.h    | 1 -
 fs/lustre/obdclass/llog_obd.c         | 1 -
 fs/lustre/obdclass/llog_swab.c        | 1 -
 fs/lustre/obdclass/lprocfs_counters.c | 1 -
 fs/lustre/obdclass/lprocfs_status.c   | 1 -
 fs/lustre/obdclass/lu_object.c        | 1 -
 fs/lustre/obdclass/lu_ref.c           | 1 -
 fs/lustre/obdclass/lu_tgt_pool.c      | 2 --
 fs/lustre/obdclass/lustre_handles.c   | 1 -
 fs/lustre/obdclass/lustre_peer.c      | 1 -
 fs/lustre/obdclass/obd_config.c       | 1 -
 fs/lustre/obdclass/obd_mount.c        | 1 -
 fs/lustre/obdclass/obd_sysfs.c        | 1 -
 fs/lustre/obdclass/obdo.c             | 1 -
 fs/lustre/obdclass/statfs_pack.c      | 1 -
 fs/lustre/obdecho/debug.c             | 1 -
 fs/lustre/obdecho/echo_client.c       | 1 -
 fs/lustre/obdecho/echo_internal.h     | 1 -
 fs/lustre/osc/lproc_osc.c             | 1 -
 fs/lustre/osc/osc_cache.c             | 1 -
 fs/lustre/osc/osc_dev.c               | 1 -
 fs/lustre/osc/osc_internal.h          | 1 -
 fs/lustre/osc/osc_io.c                | 1 -
 fs/lustre/osc/osc_lock.c              | 1 -
 fs/lustre/osc/osc_object.c            | 1 -
 fs/lustre/osc/osc_page.c              | 1 -
 fs/lustre/osc/osc_request.c           | 1 -
 fs/lustre/ptlrpc/client.c             | 1 -
 fs/lustre/ptlrpc/connection.c         | 1 -
 fs/lustre/ptlrpc/events.c             | 1 -
 fs/lustre/ptlrpc/import.c             | 1 -
 fs/lustre/ptlrpc/layout.c             | 1 -
 fs/lustre/ptlrpc/llog_client.c        | 1 -
 fs/lustre/ptlrpc/llog_net.c           | 1 -
 fs/lustre/ptlrpc/lproc_ptlrpc.c       | 1 -
 fs/lustre/ptlrpc/niobuf.c             | 1 -
 fs/lustre/ptlrpc/pack_generic.c       | 1 -
 fs/lustre/ptlrpc/pers.c               | 1 -
 fs/lustre/ptlrpc/pinger.c             | 1 -
 fs/lustre/ptlrpc/ptlrpc_internal.h    | 1 -
 fs/lustre/ptlrpc/ptlrpc_module.c      | 1 -
 fs/lustre/ptlrpc/ptlrpcd.c            | 1 -
 fs/lustre/ptlrpc/recover.c            | 1 -
 fs/lustre/ptlrpc/sec.c                | 1 -
 fs/lustre/ptlrpc/sec_bulk.c           | 1 -
 fs/lustre/ptlrpc/sec_config.c         | 1 -
 fs/lustre/ptlrpc/sec_gc.c             | 1 -
 fs/lustre/ptlrpc/sec_lproc.c          | 1 -
 fs/lustre/ptlrpc/sec_null.c           | 1 -
 fs/lustre/ptlrpc/sec_plain.c          | 1 -
 fs/lustre/ptlrpc/service.c            | 1 -
 fs/lustre/ptlrpc/wiretest.c           | 1 -
 137 files changed, 139 deletions(-)

diff --git a/fs/lustre/fid/fid_internal.h b/fs/lustre/fid/fid_internal.h
index cbf0987..5256e87 100644
--- a/fs/lustre/fid/fid_internal.h
+++ b/fs/lustre/fid/fid_internal.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/fid/fid_internal.h
  *
diff --git a/fs/lustre/fid/fid_lib.c b/fs/lustre/fid/fid_lib.c
index 6b06847..dc1537d 100644
--- a/fs/lustre/fid/fid_lib.c
+++ b/fs/lustre/fid/fid_lib.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/fid/fid_lib.c
  *
diff --git a/fs/lustre/fid/fid_request.c b/fs/lustre/fid/fid_request.c
index a7013d1..c41932f 100644
--- a/fs/lustre/fid/fid_request.c
+++ b/fs/lustre/fid/fid_request.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/fid/fid_request.c
  *
diff --git a/fs/lustre/fid/lproc_fid.c b/fs/lustre/fid/lproc_fid.c
index be9846b..8f6a4a8 100644
--- a/fs/lustre/fid/lproc_fid.c
+++ b/fs/lustre/fid/lproc_fid.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/fid/lproc_fid.c
  *
diff --git a/fs/lustre/fld/fld_cache.c b/fs/lustre/fld/fld_cache.c
index f288907..f64ae65 100644
--- a/fs/lustre/fld/fld_cache.c
+++ b/fs/lustre/fld/fld_cache.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/fld/fld_cache.c
  *
diff --git a/fs/lustre/fld/fld_internal.h b/fs/lustre/fld/fld_internal.h
index d32360c..83c3a3e 100644
--- a/fs/lustre/fld/fld_internal.h
+++ b/fs/lustre/fld/fld_internal.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/fld/fld_internal.h
  *
diff --git a/fs/lustre/fld/fld_request.c b/fs/lustre/fld/fld_request.c
index 2e8d0b8..7260a14 100644
--- a/fs/lustre/fld/fld_request.c
+++ b/fs/lustre/fld/fld_request.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/fld/fld_request.c
  *
diff --git a/fs/lustre/fld/lproc_fld.c b/fs/lustre/fld/lproc_fld.c
index 9e1be53..e53cc08 100644
--- a/fs/lustre/fld/lproc_fld.c
+++ b/fs/lustre/fld/lproc_fld.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/fld/lproc_fld.c
  *
diff --git a/fs/lustre/ldlm/l_lock.c b/fs/lustre/ldlm/l_lock.c
index 3531420..639a72a 100644
--- a/fs/lustre/ldlm/l_lock.c
+++ b/fs/lustre/ldlm/l_lock.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LDLM
diff --git a/fs/lustre/ldlm/ldlm_extent.c b/fs/lustre/ldlm/ldlm_extent.c
index 7474c85..4533bdb 100644
--- a/fs/lustre/ldlm/ldlm_extent.c
+++ b/fs/lustre/ldlm/ldlm_extent.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ldlm/ldlm_extent.c
  *
diff --git a/fs/lustre/ldlm/ldlm_flock.c b/fs/lustre/ldlm/ldlm_flock.c
index b4916cb15..4ca69f8 100644
--- a/fs/lustre/ldlm/ldlm_flock.c
+++ b/fs/lustre/ldlm/ldlm_flock.c
@@ -32,7 +32,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 /**
diff --git a/fs/lustre/ldlm/ldlm_inodebits.c b/fs/lustre/ldlm/ldlm_inodebits.c
index 32de9b9..892a0dd 100644
--- a/fs/lustre/ldlm/ldlm_inodebits.c
+++ b/fs/lustre/ldlm/ldlm_inodebits.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ldlm/ldlm_inodebits.c
  *
diff --git a/fs/lustre/ldlm/ldlm_internal.h b/fs/lustre/ldlm/ldlm_internal.h
index 9dc0561..ed4fb2a 100644
--- a/fs/lustre/ldlm/ldlm_internal.h
+++ b/fs/lustre/ldlm/ldlm_internal.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 extern int ldlm_srv_namespace_nr;
diff --git a/fs/lustre/ldlm/ldlm_lib.c b/fs/lustre/ldlm/ldlm_lib.c
index 9499995..c5ee2c3 100644
--- a/fs/lustre/ldlm/ldlm_lib.c
+++ b/fs/lustre/ldlm/ldlm_lib.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 /**
diff --git a/fs/lustre/ldlm/ldlm_lock.c b/fs/lustre/ldlm/ldlm_lock.c
index 8201e28..4225c0b 100644
--- a/fs/lustre/ldlm/ldlm_lock.c
+++ b/fs/lustre/ldlm/ldlm_lock.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ldlm/ldlm_lock.c
  *
diff --git a/fs/lustre/ldlm/ldlm_lockd.c b/fs/lustre/ldlm/ldlm_lockd.c
index 7d8bae2..04fe92e 100644
--- a/fs/lustre/ldlm/ldlm_lockd.c
+++ b/fs/lustre/ldlm/ldlm_lockd.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ldlm/ldlm_lockd.c
  *
diff --git a/fs/lustre/ldlm/ldlm_plain.c b/fs/lustre/ldlm/ldlm_plain.c
index e7357ee..e70597c 100644
--- a/fs/lustre/ldlm/ldlm_plain.c
+++ b/fs/lustre/ldlm/ldlm_plain.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ldlm/ldlm_plain.c
  *
diff --git a/fs/lustre/ldlm/ldlm_pool.c b/fs/lustre/ldlm/ldlm_pool.c
index b93ad4d..155b585 100644
--- a/fs/lustre/ldlm/ldlm_pool.c
+++ b/fs/lustre/ldlm/ldlm_pool.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ldlm/ldlm_pool.c
  *
diff --git a/fs/lustre/ldlm/ldlm_request.c b/fs/lustre/ldlm/ldlm_request.c
index 3527678..7718e07 100644
--- a/fs/lustre/ldlm/ldlm_request.c
+++ b/fs/lustre/ldlm/ldlm_request.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 /**
  * This file contains Asynchronous System Trap (AST) handlers and related
diff --git a/fs/lustre/ldlm/ldlm_resource.c b/fs/lustre/ldlm/ldlm_resource.c
index 6e3feb2..d4b6e41 100644
--- a/fs/lustre/ldlm/ldlm_resource.c
+++ b/fs/lustre/ldlm/ldlm_resource.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ldlm/ldlm_resource.c
  *
diff --git a/fs/lustre/llite/acl.c b/fs/lustre/llite/acl.c
index 2ee9ff9..f4cc149 100644
--- a/fs/lustre/llite/acl.c
+++ b/fs/lustre/llite/acl.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/llite/acl.c
  */
diff --git a/fs/lustre/llite/dcache.c b/fs/lustre/llite/dcache.c
index 0a6d773..cf6619f 100644
--- a/fs/lustre/llite/dcache.c
+++ b/fs/lustre/llite/dcache.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #include <linux/fs.h>
diff --git a/fs/lustre/llite/dir.c b/fs/lustre/llite/dir.c
index 21b40d1..bf2d9fe 100644
--- a/fs/lustre/llite/dir.c
+++ b/fs/lustre/llite/dir.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/llite/dir.c
  *
diff --git a/fs/lustre/llite/file.c b/fs/lustre/llite/file.c
index c8f250c..1561af1 100644
--- a/fs/lustre/llite/file.c
+++ b/fs/lustre/llite/file.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/llite/file.c
  *
diff --git a/fs/lustre/llite/glimpse.c b/fs/lustre/llite/glimpse.c
index 3d23612..c55d079 100644
--- a/fs/lustre/llite/glimpse.c
+++ b/fs/lustre/llite/glimpse.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * glimpse code used by vvp (and other Lustre clients in the future).
  *
diff --git a/fs/lustre/llite/lcommon_cl.c b/fs/lustre/llite/lcommon_cl.c
index c945351..f0d8f78 100644
--- a/fs/lustre/llite/lcommon_cl.c
+++ b/fs/lustre/llite/lcommon_cl.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  *   Author: Nikita Danilov <nikita.danilov@sun.com>
  */
diff --git a/fs/lustre/llite/lcommon_misc.c b/fs/lustre/llite/lcommon_misc.c
index d833a16..3b0c0f4 100644
--- a/fs/lustre/llite/lcommon_misc.c
+++ b/fs/lustre/llite/lcommon_misc.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * cl code used by vvp (and other Lustre clients in the future).
  *
diff --git a/fs/lustre/llite/llite_internal.h b/fs/lustre/llite/llite_internal.h
index dc9ea03..669500b 100644
--- a/fs/lustre/llite/llite_internal.h
+++ b/fs/lustre/llite/llite_internal.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef LLITE_INTERNAL_H
diff --git a/fs/lustre/llite/llite_lib.c b/fs/lustre/llite/llite_lib.c
index 6af95fd..f520b34 100644
--- a/fs/lustre/llite/llite_lib.c
+++ b/fs/lustre/llite/llite_lib.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/llite/llite_lib.c
  *
diff --git a/fs/lustre/llite/llite_mmap.c b/fs/lustre/llite/llite_mmap.c
index 0963757..a234a83 100644
--- a/fs/lustre/llite/llite_mmap.c
+++ b/fs/lustre/llite/llite_mmap.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #include <linux/kernel.h>
diff --git a/fs/lustre/llite/llite_nfs.c b/fs/lustre/llite/llite_nfs.c
index a57ab51..bf15023 100644
--- a/fs/lustre/llite/llite_nfs.c
+++ b/fs/lustre/llite/llite_nfs.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/lustre/llite/llite_nfs.c
  *
diff --git a/fs/lustre/llite/lproc_llite.c b/fs/lustre/llite/lproc_llite.c
index 4ce6fab..3ca553d 100644
--- a/fs/lustre/llite/lproc_llite.c
+++ b/fs/lustre/llite/lproc_llite.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 #define DEBUG_SUBSYSTEM S_LLITE
 
diff --git a/fs/lustre/llite/namei.c b/fs/lustre/llite/namei.c
index 654d065..7f1fd5c 100644
--- a/fs/lustre/llite/namei.c
+++ b/fs/lustre/llite/namei.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #include <linux/fs.h>
diff --git a/fs/lustre/llite/rw.c b/fs/lustre/llite/rw.c
index c64696d..08ab25d 100644
--- a/fs/lustre/llite/rw.c
+++ b/fs/lustre/llite/rw.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/llite/rw.c
  *
diff --git a/fs/lustre/llite/rw26.c b/fs/lustre/llite/rw26.c
index 91a05ac..74f3b0b 100644
--- a/fs/lustre/llite/rw26.c
+++ b/fs/lustre/llite/rw26.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/lustre/llite/rw26.c
  *
diff --git a/fs/lustre/llite/statahead.c b/fs/lustre/llite/statahead.c
index a7d3a43..995a9e1 100644
--- a/fs/lustre/llite/statahead.c
+++ b/fs/lustre/llite/statahead.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #include <linux/fs.h>
diff --git a/fs/lustre/llite/super25.c b/fs/lustre/llite/super25.c
index 1b074a6..decfa2f 100644
--- a/fs/lustre/llite/super25.c
+++ b/fs/lustre/llite/super25.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LLITE
diff --git a/fs/lustre/llite/symlink.c b/fs/lustre/llite/symlink.c
index aae449c..f78db86 100644
--- a/fs/lustre/llite/symlink.c
+++ b/fs/lustre/llite/symlink.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #include <linux/fs.h>
diff --git a/fs/lustre/llite/vvp_dev.c b/fs/lustre/llite/vvp_dev.c
index aa8b2c5..fdcd314 100644
--- a/fs/lustre/llite/vvp_dev.c
+++ b/fs/lustre/llite/vvp_dev.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * cl_device and cl_device_type implementation for VVP layer.
  *
diff --git a/fs/lustre/llite/vvp_internal.h b/fs/lustre/llite/vvp_internal.h
index 6956d6b..f2599be 100644
--- a/fs/lustre/llite/vvp_internal.h
+++ b/fs/lustre/llite/vvp_internal.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Internal definitions for VVP layer.
  *
diff --git a/fs/lustre/llite/vvp_io.c b/fs/lustre/llite/vvp_io.c
index 38a9430..e98792b 100644
--- a/fs/lustre/llite/vvp_io.c
+++ b/fs/lustre/llite/vvp_io.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Implementation of cl_io for VVP layer.
  *
diff --git a/fs/lustre/llite/vvp_object.c b/fs/lustre/llite/vvp_object.c
index 0c40814..e999caa 100644
--- a/fs/lustre/llite/vvp_object.c
+++ b/fs/lustre/llite/vvp_object.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * cl_object implementation for VVP layer.
  *
diff --git a/fs/lustre/llite/vvp_page.c b/fs/lustre/llite/vvp_page.c
index b0a119e..86353df 100644
--- a/fs/lustre/llite/vvp_page.c
+++ b/fs/lustre/llite/vvp_page.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Implementation of cl_page for VVP layer.
  *
diff --git a/fs/lustre/llite/xattr.c b/fs/lustre/llite/xattr.c
index 7004893..cd973eb 100644
--- a/fs/lustre/llite/xattr.c
+++ b/fs/lustre/llite/xattr.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #include <linux/fs.h>
diff --git a/fs/lustre/lmv/lmv_fld.c b/fs/lustre/lmv/lmv_fld.c
index ea1ef72..8acad7a 100644
--- a/fs/lustre/lmv/lmv_fld.c
+++ b/fs/lustre/lmv/lmv_fld.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LMV
diff --git a/fs/lustre/lmv/lmv_intent.c b/fs/lustre/lmv/lmv_intent.c
index 2a15ec2..398bd17 100644
--- a/fs/lustre/lmv/lmv_intent.c
+++ b/fs/lustre/lmv/lmv_intent.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LMV
diff --git a/fs/lustre/lmv/lmv_internal.h b/fs/lustre/lmv/lmv_internal.h
index e42b141..9e89f88 100644
--- a/fs/lustre/lmv/lmv_internal.h
+++ b/fs/lustre/lmv/lmv_internal.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef _LMV_INTERNAL_H_
diff --git a/fs/lustre/lmv/lmv_obd.c b/fs/lustre/lmv/lmv_obd.c
index 6555c6e..4fa441e 100644
--- a/fs/lustre/lmv/lmv_obd.c
+++ b/fs/lustre/lmv/lmv_obd.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LMV
diff --git a/fs/lustre/lmv/lproc_lmv.c b/fs/lustre/lmv/lproc_lmv.c
index 85963d2..767b40e 100644
--- a/fs/lustre/lmv/lproc_lmv.c
+++ b/fs/lustre/lmv/lproc_lmv.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
diff --git a/fs/lustre/lov/lov_cl_internal.h b/fs/lustre/lov/lov_cl_internal.h
index f231be9..7fcc327 100644
--- a/fs/lustre/lov/lov_cl_internal.h
+++ b/fs/lustre/lov/lov_cl_internal.h
@@ -28,11 +28,9 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Internal interfaces of LOV layer.
  *
diff --git a/fs/lustre/lov/lov_dev.c b/fs/lustre/lov/lov_dev.c
index a4e6b91..e001e68 100644
--- a/fs/lustre/lov/lov_dev.c
+++ b/fs/lustre/lov/lov_dev.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Implementation of cl_device and cl_device_type for LOV layer.
  *
diff --git a/fs/lustre/lov/lov_ea.c b/fs/lustre/lov/lov_ea.c
index f6b3df0..d2171a3 100644
--- a/fs/lustre/lov/lov_ea.c
+++ b/fs/lustre/lov/lov_ea.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/lov/lov_ea.c
  *
diff --git a/fs/lustre/lov/lov_internal.h b/fs/lustre/lov/lov_internal.h
index e58235a..8c0b6fa 100644
--- a/fs/lustre/lov/lov_internal.h
+++ b/fs/lustre/lov/lov_internal.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef LOV_INTERNAL_H
diff --git a/fs/lustre/lov/lov_io.c b/fs/lustre/lov/lov_io.c
index 1d5ea41..86e3fbd 100644
--- a/fs/lustre/lov/lov_io.c
+++ b/fs/lustre/lov/lov_io.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Implementation of cl_io for LOV layer.
  *
diff --git a/fs/lustre/lov/lov_lock.c b/fs/lustre/lov/lov_lock.c
index c79f728..efaca37 100644
--- a/fs/lustre/lov/lov_lock.c
+++ b/fs/lustre/lov/lov_lock.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Implementation of cl_lock for LOV layer.
  *
diff --git a/fs/lustre/lov/lov_merge.c b/fs/lustre/lov/lov_merge.c
index 7728630..8800c5f 100644
--- a/fs/lustre/lov/lov_merge.c
+++ b/fs/lustre/lov/lov_merge.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LOV
diff --git a/fs/lustre/lov/lov_obd.c b/fs/lustre/lov/lov_obd.c
index 20e0be0..42a137d 100644
--- a/fs/lustre/lov/lov_obd.c
+++ b/fs/lustre/lov/lov_obd.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/lov/lov_obd.c
  *
diff --git a/fs/lustre/lov/lov_object.c b/fs/lustre/lov/lov_object.c
index db4070f..ee61983 100644
--- a/fs/lustre/lov/lov_object.c
+++ b/fs/lustre/lov/lov_object.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Implementation of cl_object for LOV layer.
  *
diff --git a/fs/lustre/lov/lov_offset.c b/fs/lustre/lov/lov_offset.c
index 2493331..73c3f1b 100644
--- a/fs/lustre/lov/lov_offset.c
+++ b/fs/lustre/lov/lov_offset.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LOV
diff --git a/fs/lustre/lov/lov_pack.c b/fs/lustre/lov/lov_pack.c
index c97093e..9b5fb9c 100644
--- a/fs/lustre/lov/lov_pack.c
+++ b/fs/lustre/lov/lov_pack.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/lov/lov_pack.c
  *
diff --git a/fs/lustre/lov/lov_page.c b/fs/lustre/lov/lov_page.c
index da036f2..fdc415b 100644
--- a/fs/lustre/lov/lov_page.c
+++ b/fs/lustre/lov/lov_page.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Implementation of cl_page for LOV layer.
  *
diff --git a/fs/lustre/lov/lov_pool.c b/fs/lustre/lov/lov_pool.c
index 8fbc6ee..d01c475 100644
--- a/fs/lustre/lov/lov_pool.c
+++ b/fs/lustre/lov/lov_pool.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/lov/lov_pool.c
  *
diff --git a/fs/lustre/lov/lov_request.c b/fs/lustre/lov/lov_request.c
index d263cec..0ae53a7 100644
--- a/fs/lustre/lov/lov_request.c
+++ b/fs/lustre/lov/lov_request.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LOV
diff --git a/fs/lustre/lov/lovsub_dev.c b/fs/lustre/lov/lovsub_dev.c
index 0555737..a0eeb06 100644
--- a/fs/lustre/lov/lovsub_dev.c
+++ b/fs/lustre/lov/lovsub_dev.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Implementation of cl_device and cl_device_type for LOVSUB layer.
  *
diff --git a/fs/lustre/lov/lovsub_object.c b/fs/lustre/lov/lovsub_object.c
index eef1713..672ea3b 100644
--- a/fs/lustre/lov/lovsub_object.c
+++ b/fs/lustre/lov/lovsub_object.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Implementation of cl_object for LOVSUB layer.
  *
diff --git a/fs/lustre/lov/lproc_lov.c b/fs/lustre/lov/lproc_lov.c
index e95a907..95fb4ef 100644
--- a/fs/lustre/lov/lproc_lov.c
+++ b/fs/lustre/lov/lproc_lov.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 #define DEBUG_SUBSYSTEM S_CLASS
 
diff --git a/fs/lustre/mdc/lproc_mdc.c b/fs/lustre/mdc/lproc_mdc.c
index af2b725..02636ef 100644
--- a/fs/lustre/mdc/lproc_mdc.c
+++ b/fs/lustre/mdc/lproc_mdc.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 #define DEBUG_SUBSYSTEM S_CLASS
 
diff --git a/fs/lustre/mdc/mdc_internal.h b/fs/lustre/mdc/mdc_internal.h
index 91e8240..06b0637 100644
--- a/fs/lustre/mdc/mdc_internal.h
+++ b/fs/lustre/mdc/mdc_internal.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef _MDC_INTERNAL_H
diff --git a/fs/lustre/mdc/mdc_lib.c b/fs/lustre/mdc/mdc_lib.c
index 69261b2..37fcb38 100644
--- a/fs/lustre/mdc/mdc_lib.c
+++ b/fs/lustre/mdc/mdc_lib.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_MDC
diff --git a/fs/lustre/mdc/mdc_locks.c b/fs/lustre/mdc/mdc_locks.c
index dbf402a..5373ec9 100644
--- a/fs/lustre/mdc/mdc_locks.c
+++ b/fs/lustre/mdc/mdc_locks.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_MDC
diff --git a/fs/lustre/mdc/mdc_reint.c b/fs/lustre/mdc/mdc_reint.c
index 9e566e7..786b23d 100644
--- a/fs/lustre/mdc/mdc_reint.c
+++ b/fs/lustre/mdc/mdc_reint.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_MDC
diff --git a/fs/lustre/mdc/mdc_request.c b/fs/lustre/mdc/mdc_request.c
index fb9971f..e6c0df5 100644
--- a/fs/lustre/mdc/mdc_request.c
+++ b/fs/lustre/mdc/mdc_request.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_MDC
diff --git a/fs/lustre/mgc/lproc_mgc.c b/fs/lustre/mgc/lproc_mgc.c
index dd7ed0f..6a945c5 100644
--- a/fs/lustre/mgc/lproc_mgc.c
+++ b/fs/lustre/mgc/lproc_mgc.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 #define DEBUG_SUBSYSTEM S_CLASS
 
diff --git a/fs/lustre/mgc/mgc_internal.h b/fs/lustre/mgc/mgc_internal.h
index 7a6e77b..e323f90 100644
--- a/fs/lustre/mgc/mgc_internal.h
+++ b/fs/lustre/mgc/mgc_internal.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef _MGC_INTERNAL_H
diff --git a/fs/lustre/mgc/mgc_request.c b/fs/lustre/mgc/mgc_request.c
index 4b60056a..c2ad5d3 100644
--- a/fs/lustre/mgc/mgc_request.c
+++ b/fs/lustre/mgc/mgc_request.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/mgc/mgc_request.c
  *
diff --git a/fs/lustre/obdclass/cl_internal.h b/fs/lustre/obdclass/cl_internal.h
index 64a5ab2..db9dd98 100644
--- a/fs/lustre/obdclass/cl_internal.h
+++ b/fs/lustre/obdclass/cl_internal.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Internal cl interfaces.
  *
diff --git a/fs/lustre/obdclass/cl_io.c b/fs/lustre/obdclass/cl_io.c
index ca4d387..6c22137 100644
--- a/fs/lustre/obdclass/cl_io.c
+++ b/fs/lustre/obdclass/cl_io.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Client IO.
  *
diff --git a/fs/lustre/obdclass/cl_lock.c b/fs/lustre/obdclass/cl_lock.c
index 0c02546..9617764 100644
--- a/fs/lustre/obdclass/cl_lock.c
+++ b/fs/lustre/obdclass/cl_lock.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Client Extent Lock.
  *
diff --git a/fs/lustre/obdclass/cl_object.c b/fs/lustre/obdclass/cl_object.c
index aa3d928..c5deb5c 100644
--- a/fs/lustre/obdclass/cl_object.c
+++ b/fs/lustre/obdclass/cl_object.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Client Lustre Object.
  *
diff --git a/fs/lustre/obdclass/cl_page.c b/fs/lustre/obdclass/cl_page.c
index 2cf8d30..4b6386c 100644
--- a/fs/lustre/obdclass/cl_page.c
+++ b/fs/lustre/obdclass/cl_page.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Client Lustre Page.
  *
diff --git a/fs/lustre/obdclass/class_obd.c b/fs/lustre/obdclass/class_obd.c
index 38b8967..b30d941 100644
--- a/fs/lustre/obdclass/class_obd.c
+++ b/fs/lustre/obdclass/class_obd.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_CLASS
diff --git a/fs/lustre/obdclass/genops.c b/fs/lustre/obdclass/genops.c
index 7bc4dab..bbb63b2 100644
--- a/fs/lustre/obdclass/genops.c
+++ b/fs/lustre/obdclass/genops.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/genops.c
  *
diff --git a/fs/lustre/obdclass/kernelcomm.c b/fs/lustre/obdclass/kernelcomm.c
index bc9b0f2..e59b6aa 100644
--- a/fs/lustre/obdclass/kernelcomm.c
+++ b/fs/lustre/obdclass/kernelcomm.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Author: Nathan Rutman <nathan.rutman@sun.com>
  *
diff --git a/fs/lustre/obdclass/llog.c b/fs/lustre/obdclass/llog.c
index b431087..c342734 100644
--- a/fs/lustre/obdclass/llog.c
+++ b/fs/lustre/obdclass/llog.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/llog.c
  *
diff --git a/fs/lustre/obdclass/llog_cat.c b/fs/lustre/obdclass/llog_cat.c
index b67e7a2b..7f55895 100644
--- a/fs/lustre/obdclass/llog_cat.c
+++ b/fs/lustre/obdclass/llog_cat.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/llog_cat.c
  *
diff --git a/fs/lustre/obdclass/llog_internal.h b/fs/lustre/obdclass/llog_internal.h
index 41ac4f0..7a10389 100644
--- a/fs/lustre/obdclass/llog_internal.h
+++ b/fs/lustre/obdclass/llog_internal.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef __LLOG_INTERNAL_H__
diff --git a/fs/lustre/obdclass/llog_obd.c b/fs/lustre/obdclass/llog_obd.c
index 82f96ed..4743dc9 100644
--- a/fs/lustre/obdclass/llog_obd.c
+++ b/fs/lustre/obdclass/llog_obd.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_LOG
diff --git a/fs/lustre/obdclass/llog_swab.c b/fs/lustre/obdclass/llog_swab.c
index c18ca95..0b83dc3 100644
--- a/fs/lustre/obdclass/llog_swab.c
+++ b/fs/lustre/obdclass/llog_swab.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/llog_swab.c
  *
diff --git a/fs/lustre/obdclass/lprocfs_counters.c b/fs/lustre/obdclass/lprocfs_counters.c
index c7bf1ee..55cb12c 100644
--- a/fs/lustre/obdclass/lprocfs_counters.c
+++ b/fs/lustre/obdclass/lprocfs_counters.c
@@ -29,7 +29,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/lprocfs_counters.c
  *
diff --git a/fs/lustre/obdclass/lprocfs_status.c b/fs/lustre/obdclass/lprocfs_status.c
index 0ed1bd5..cd5a2fa 100644
--- a/fs/lustre/obdclass/lprocfs_status.c
+++ b/fs/lustre/obdclass/lprocfs_status.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/lprocfs_status.c
  *
diff --git a/fs/lustre/obdclass/lu_object.c b/fs/lustre/obdclass/lu_object.c
index 419cb74..b49e0cd 100644
--- a/fs/lustre/obdclass/lu_object.c
+++ b/fs/lustre/obdclass/lu_object.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/lu_object.c
  *
diff --git a/fs/lustre/obdclass/lu_ref.c b/fs/lustre/obdclass/lu_ref.c
index 9b32c3c..fd7ac39 100644
--- a/fs/lustre/obdclass/lu_ref.c
+++ b/fs/lustre/obdclass/lu_ref.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/lu_ref.c
  *
diff --git a/fs/lustre/obdclass/lu_tgt_pool.c b/fs/lustre/obdclass/lu_tgt_pool.c
index fc5e298..5d8e362 100644
--- a/fs/lustre/obdclass/lu_tgt_pool.c
+++ b/fs/lustre/obdclass/lu_tgt_pool.c
@@ -21,14 +21,12 @@
  * GPL HEADER END
  */
 /*
- * Copyright  2008 Sun Microsystems, Inc. All rights reserved
  * Use is subject to license terms.
  *
  * Copyright (c) 2012, 2017, Intel Corporation.
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 /*
  * lustre/target/tgt_pool.c
diff --git a/fs/lustre/obdclass/lustre_handles.c b/fs/lustre/obdclass/lustre_handles.c
index 7ecd15ad3..16099a4 100644
--- a/fs/lustre/obdclass/lustre_handles.c
+++ b/fs/lustre/obdclass/lustre_handles.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/lustre_handles.c
  *
diff --git a/fs/lustre/obdclass/lustre_peer.c b/fs/lustre/obdclass/lustre_peer.c
index 2675594..c0a0bfb 100644
--- a/fs/lustre/obdclass/lustre_peer.c
+++ b/fs/lustre/obdclass/lustre_peer.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
diff --git a/fs/lustre/obdclass/obd_config.c b/fs/lustre/obdclass/obd_config.c
index 8f062bb..3a0dbd5 100644
--- a/fs/lustre/obdclass/obd_config.c
+++ b/fs/lustre/obdclass/obd_config.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/obd_config.c
  *
diff --git a/fs/lustre/obdclass/obd_mount.c b/fs/lustre/obdclass/obd_mount.c
index ea5b469..fbad459 100644
--- a/fs/lustre/obdclass/obd_mount.c
+++ b/fs/lustre/obdclass/obd_mount.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/obd_mount.c
  *
diff --git a/fs/lustre/obdclass/obd_sysfs.c b/fs/lustre/obdclass/obd_sysfs.c
index e6fb1b9..43bbbe9 100644
--- a/fs/lustre/obdclass/obd_sysfs.c
+++ b/fs/lustre/obdclass/obd_sysfs.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/linux/linux-module.c
  *
diff --git a/fs/lustre/obdclass/obdo.c b/fs/lustre/obdclass/obdo.c
index 8fd2922..7df4ff3 100644
--- a/fs/lustre/obdclass/obdo.c
+++ b/fs/lustre/obdclass/obdo.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/obdo.c
  *
diff --git a/fs/lustre/obdclass/statfs_pack.c b/fs/lustre/obdclass/statfs_pack.c
index 355e888..e1d1f56 100644
--- a/fs/lustre/obdclass/statfs_pack.c
+++ b/fs/lustre/obdclass/statfs_pack.c
@@ -26,7 +26,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/statfs_pack.c
  *
diff --git a/fs/lustre/obdecho/debug.c b/fs/lustre/obdecho/debug.c
index 130d3bf..df30035 100644
--- a/fs/lustre/obdecho/debug.c
+++ b/fs/lustre/obdecho/debug.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdclass/debug.c
  *
diff --git a/fs/lustre/obdecho/echo_client.c b/fs/lustre/obdecho/echo_client.c
index 270226b..0452942 100644
--- a/fs/lustre/obdecho/echo_client.c
+++ b/fs/lustre/obdecho/echo_client.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_ECHO
diff --git a/fs/lustre/obdecho/echo_internal.h b/fs/lustre/obdecho/echo_internal.h
index 95b0149..5736b17 100644
--- a/fs/lustre/obdecho/echo_internal.h
+++ b/fs/lustre/obdecho/echo_internal.h
@@ -24,7 +24,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/obdecho/echo_internal.h
  */
diff --git a/fs/lustre/osc/lproc_osc.c b/fs/lustre/osc/lproc_osc.c
index df48c76..3991b2c 100644
--- a/fs/lustre/osc/lproc_osc.c
+++ b/fs/lustre/osc/lproc_osc.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 #define DEBUG_SUBSYSTEM S_CLASS
 
diff --git a/fs/lustre/osc/osc_cache.c b/fs/lustre/osc/osc_cache.c
index e85f320..fc8079a 100644
--- a/fs/lustre/osc/osc_cache.c
+++ b/fs/lustre/osc/osc_cache.c
@@ -29,7 +29,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * osc cache management.
  *
diff --git a/fs/lustre/osc/osc_dev.c b/fs/lustre/osc/osc_dev.c
index 6469973..621beb6 100644
--- a/fs/lustre/osc/osc_dev.c
+++ b/fs/lustre/osc/osc_dev.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Implementation of cl_device, for OSC layer.
  *
diff --git a/fs/lustre/osc/osc_internal.h b/fs/lustre/osc/osc_internal.h
index fc3ca8a..3b65f2d 100644
--- a/fs/lustre/osc/osc_internal.h
+++ b/fs/lustre/osc/osc_internal.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #ifndef OSC_INTERNAL_H
diff --git a/fs/lustre/osc/osc_io.c b/fs/lustre/osc/osc_io.c
index ce64cf8..b792c22 100644
--- a/fs/lustre/osc/osc_io.c
+++ b/fs/lustre/osc/osc_io.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Implementation of cl_io for OSC layer.
  *
diff --git a/fs/lustre/osc/osc_lock.c b/fs/lustre/osc/osc_lock.c
index 6ff3fb6..de96fc0 100644
--- a/fs/lustre/osc/osc_lock.c
+++ b/fs/lustre/osc/osc_lock.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Implementation of cl_lock for OSC layer.
  *
diff --git a/fs/lustre/osc/osc_object.c b/fs/lustre/osc/osc_object.c
index 00f2800..8f36789 100644
--- a/fs/lustre/osc/osc_object.c
+++ b/fs/lustre/osc/osc_object.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Implementation of cl_object for OSC layer.
  *
diff --git a/fs/lustre/osc/osc_page.c b/fs/lustre/osc/osc_page.c
index 8b25329a..94db9d2 100644
--- a/fs/lustre/osc/osc_page.c
+++ b/fs/lustre/osc/osc_page.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * Implementation of cl_page for OSC layer.
  *
diff --git a/fs/lustre/osc/osc_request.c b/fs/lustre/osc/osc_request.c
index 376afb9..e49d73f 100644
--- a/fs/lustre/osc/osc_request.c
+++ b/fs/lustre/osc/osc_request.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_OSC
diff --git a/fs/lustre/ptlrpc/client.c b/fs/lustre/ptlrpc/client.c
index a818b01..97f1251 100644
--- a/fs/lustre/ptlrpc/client.c
+++ b/fs/lustre/ptlrpc/client.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 /** Implementation of client-side PortalRPC interfaces */
diff --git a/fs/lustre/ptlrpc/connection.c b/fs/lustre/ptlrpc/connection.c
index 1551a9a..0415357 100644
--- a/fs/lustre/ptlrpc/connection.c
+++ b/fs/lustre/ptlrpc/connection.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
diff --git a/fs/lustre/ptlrpc/events.c b/fs/lustre/ptlrpc/events.c
index e348e4a..c81181d 100644
--- a/fs/lustre/ptlrpc/events.c
+++ b/fs/lustre/ptlrpc/events.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
diff --git a/fs/lustre/ptlrpc/import.c b/fs/lustre/ptlrpc/import.c
index 5e33ebc..317f28c 100644
--- a/fs/lustre/ptlrpc/import.c
+++ b/fs/lustre/ptlrpc/import.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ptlrpc/import.c
  *
diff --git a/fs/lustre/ptlrpc/layout.c b/fs/lustre/ptlrpc/layout.c
index 11c0d50..8bbe68b 100644
--- a/fs/lustre/ptlrpc/layout.c
+++ b/fs/lustre/ptlrpc/layout.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ptlrpc/layout.c
  *
diff --git a/fs/lustre/ptlrpc/llog_client.c b/fs/lustre/ptlrpc/llog_client.c
index 8bbff60..aa4a808 100644
--- a/fs/lustre/ptlrpc/llog_client.c
+++ b/fs/lustre/ptlrpc/llog_client.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ptlrpc/llog_client.c
  *
diff --git a/fs/lustre/ptlrpc/llog_net.c b/fs/lustre/ptlrpc/llog_net.c
index 1d86fb3..0090d00 100644
--- a/fs/lustre/ptlrpc/llog_net.c
+++ b/fs/lustre/ptlrpc/llog_net.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ptlrpc/llog_net.c
  *
diff --git a/fs/lustre/ptlrpc/lproc_ptlrpc.c b/fs/lustre/ptlrpc/lproc_ptlrpc.c
index 26ca55e..b291374 100644
--- a/fs/lustre/ptlrpc/lproc_ptlrpc.c
+++ b/fs/lustre/ptlrpc/lproc_ptlrpc.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 #define DEBUG_SUBSYSTEM S_CLASS
 
diff --git a/fs/lustre/ptlrpc/niobuf.c b/fs/lustre/ptlrpc/niobuf.c
index 5ae7dd1..cf9940b 100644
--- a/fs/lustre/ptlrpc/niobuf.c
+++ b/fs/lustre/ptlrpc/niobuf.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
diff --git a/fs/lustre/ptlrpc/pack_generic.c b/fs/lustre/ptlrpc/pack_generic.c
index fbed952..5dbab3d 100644
--- a/fs/lustre/ptlrpc/pack_generic.c
+++ b/fs/lustre/ptlrpc/pack_generic.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ptlrpc/pack_generic.c
  *
diff --git a/fs/lustre/ptlrpc/pers.c b/fs/lustre/ptlrpc/pers.c
index 78b8ce2..e24c8e3 100644
--- a/fs/lustre/ptlrpc/pers.c
+++ b/fs/lustre/ptlrpc/pers.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
diff --git a/fs/lustre/ptlrpc/pinger.c b/fs/lustre/ptlrpc/pinger.c
index 99d077b..f565982 100644
--- a/fs/lustre/ptlrpc/pinger.c
+++ b/fs/lustre/ptlrpc/pinger.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ptlrpc/pinger.c
  *
diff --git a/fs/lustre/ptlrpc/ptlrpc_internal.h b/fs/lustre/ptlrpc/ptlrpc_internal.h
index 248f9cb..62c3c97 100644
--- a/fs/lustre/ptlrpc/ptlrpc_internal.h
+++ b/fs/lustre/ptlrpc/ptlrpc_internal.h
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 /* Intramodule declarations for ptlrpc. */
diff --git a/fs/lustre/ptlrpc/ptlrpc_module.c b/fs/lustre/ptlrpc/ptlrpc_module.c
index 85fb0fa..8379bc4 100644
--- a/fs/lustre/ptlrpc/ptlrpc_module.c
+++ b/fs/lustre/ptlrpc/ptlrpc_module.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
diff --git a/fs/lustre/ptlrpc/ptlrpcd.c b/fs/lustre/ptlrpc/ptlrpcd.c
index ef24b0e..ed3f0e1 100644
--- a/fs/lustre/ptlrpc/ptlrpcd.c
+++ b/fs/lustre/ptlrpc/ptlrpcd.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ptlrpc/ptlrpcd.c
  */
diff --git a/fs/lustre/ptlrpc/recover.c b/fs/lustre/ptlrpc/recover.c
index 104af56..6ba31c1 100644
--- a/fs/lustre/ptlrpc/recover.c
+++ b/fs/lustre/ptlrpc/recover.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ptlrpc/recover.c
  *
diff --git a/fs/lustre/ptlrpc/sec.c b/fs/lustre/ptlrpc/sec.c
index ea1dafe..c65cf89 100644
--- a/fs/lustre/ptlrpc/sec.c
+++ b/fs/lustre/ptlrpc/sec.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ptlrpc/sec.c
  *
diff --git a/fs/lustre/ptlrpc/sec_bulk.c b/fs/lustre/ptlrpc/sec_bulk.c
index ef127b8..b6ae77b 100644
--- a/fs/lustre/ptlrpc/sec_bulk.c
+++ b/fs/lustre/ptlrpc/sec_bulk.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ptlrpc/sec_bulk.c
  *
diff --git a/fs/lustre/ptlrpc/sec_config.c b/fs/lustre/ptlrpc/sec_config.c
index d9e3520..d44af0f 100644
--- a/fs/lustre/ptlrpc/sec_config.c
+++ b/fs/lustre/ptlrpc/sec_config.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_SEC
diff --git a/fs/lustre/ptlrpc/sec_gc.c b/fs/lustre/ptlrpc/sec_gc.c
index 36ac319..bc76323 100644
--- a/fs/lustre/ptlrpc/sec_gc.c
+++ b/fs/lustre/ptlrpc/sec_gc.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ptlrpc/sec_gc.c
  *
diff --git a/fs/lustre/ptlrpc/sec_lproc.c b/fs/lustre/ptlrpc/sec_lproc.c
index 94f77350..8dfbb77 100644
--- a/fs/lustre/ptlrpc/sec_lproc.c
+++ b/fs/lustre/ptlrpc/sec_lproc.c
@@ -26,7 +26,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ptlrpc/sec_lproc.c
  *
diff --git a/fs/lustre/ptlrpc/sec_null.c b/fs/lustre/ptlrpc/sec_null.c
index 3892d6e..cf8f24b 100644
--- a/fs/lustre/ptlrpc/sec_null.c
+++ b/fs/lustre/ptlrpc/sec_null.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ptlrpc/sec_null.c
  *
diff --git a/fs/lustre/ptlrpc/sec_plain.c b/fs/lustre/ptlrpc/sec_plain.c
index 80831af..7920ab0 100644
--- a/fs/lustre/ptlrpc/sec_plain.c
+++ b/fs/lustre/ptlrpc/sec_plain.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  *
  * lustre/ptlrpc/sec_plain.c
  *
diff --git a/fs/lustre/ptlrpc/service.c b/fs/lustre/ptlrpc/service.c
index 1057892..3d9192d 100644
--- a/fs/lustre/ptlrpc/service.c
+++ b/fs/lustre/ptlrpc/service.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
diff --git a/fs/lustre/ptlrpc/wiretest.c b/fs/lustre/ptlrpc/wiretest.c
index a500a87..71f9e32 100644
--- a/fs/lustre/ptlrpc/wiretest.c
+++ b/fs/lustre/ptlrpc/wiretest.c
@@ -28,7 +28,6 @@
  */
 /*
  * This file is part of Lustre, http://www.lustre.org/
- * Lustre is a trademark of Sun Microsystems, Inc.
  */
 
 #define DEBUG_SUBSYSTEM S_RPC
-- 
1.8.3.1

_______________________________________________
lustre-devel mailing list
lustre-devel@lists.lustre.org
http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org

^ permalink raw reply	[flat|nested] 30+ messages in thread

end of thread, other threads:[~2021-04-25 20:10 UTC | newest]

Thread overview: 30+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-25 20:08 [lustre-devel] [PATCH 00/29] lustre: Update to OpenSFS tree as of April 25, 2020 James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 01/29] lnet: socklnd: use sockaddr instead of u32 addresses James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 02/29] lnet: allow creation of IPv6 socket James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 03/29] lnet: allow lnet_connect() to use IPv6 addresses James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 04/29] lnet: handle possiblity of IPv6 being unavailable James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 05/29] lnet: socklnd: remove tcp bonding James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 06/29] lnet: socklnd: replace route construct James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 07/29] lustre: readahead: limit over reservation James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 08/29] lustre: clio: fix hang on urgent cached pages James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 09/29] lustre: uapi: add mdt_hash_name James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 10/29] lustre: mdc: set fid2path RPC interruptible James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 11/29] lustre: include: remove references to Sun Trademark James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 12/29] lnet: o2iblnd: Use REMOTE_DROPPED for ECONNREFUSED James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 13/29] lustre: lmv: reduce struct lmv_obd size James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 14/29] lustre: uapi: remove obsolete ioctls James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 15/29] lustre: lmv: don't include struct lu_qos_rr in client James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 16/29] lnet: libcfs: fix setting of debug_path James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 17/29] lnet: Use lr_hops for avoid_asym_router_failure James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 18/29] lnet: Leverage peer aliveness more efficiently James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 19/29] lustre: mdt: mkdir should return -EEXIST if exists James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 20/29] lnet: o2iblnd: don't resend if there's no listener James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 21/29] lnet: obi2lnd: don't try to reconnect " James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 22/29] lustre: osc: fall back to vmalloc for large RPCs James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 23/29] lustre: ldlm: discard l_lock from struct ldlm_lock James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 24/29] lustre: llite: do fallocate() size checks under lock James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 25/29] lustre: misc: limit CDEBUG console message frequency James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 26/29] lustre: fallocate: Add punch mode to fallocate James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 27/29] lustre: various: only use wake_up_all() on exclusive waitqs James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 28/29] lnet: remove references to Sun Trademark James Simmons
2021-04-25 20:08 ` [lustre-devel] [PATCH 29/29] lustre: " James Simmons

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).