29 Mar, 2017

1 commit

  • When a new subscription object is inserted into name_seq->subscriptions
    list, it's under name_seq->lock protection; when a subscription is
    deleted from the list, it's also under the same lock protection;
    similarly, when accessing a subscription by going through subscriptions
    list, the entire process is also protected by the name_seq->lock.

    Therefore, if subscription refcount is increased before it's inserted
    into subscriptions list, and its refcount is decreased after it's
    deleted from the list, it will be unnecessary to hold refcount at all
    before accessing subscription object which is obtained by going through
    subscriptions list under name_seq->lock protection.

    Signed-off-by: Ying Xue
    Reviewed-by: Jon Maloy
    Signed-off-by: David S. Miller

    Ying Xue
     

21 Jan, 2017

1 commit


04 Jan, 2017

1 commit

  • During multicast reception we currently use a simple linked list with
    push/pop semantics to store port numbers.

    We now see a need for a more generic list for storing values of type
    u32. We therefore make some modifications to this list, while replacing
    the prefix 'tipc_plist_' with 'u32_'. We also add a couple of new
    functions which will come to use in the next commits.

    Acked-by: Parthasarathy Bhuvaragan
    Acked-by: Ying Xue
    Signed-off-by: Jon Maloy
    Signed-off-by: David S. Miller

    Jon Paul Maloy
     

08 Mar, 2016

1 commit


06 Feb, 2016

1 commit

  • Until now, struct tipc_subscriber has duplicate fields for
    type, upper and lower (as member of struct tipc_name_seq) at:
    1. as member seq in struct tipc_subscription
    2. as member seq in struct tipc_subscr, which is contained
    in struct tipc_event
    The former structure contains the type, upper and lower
    values in network byte order and the later contains the
    intact copy of the request.
    The struct tipc_subscription contains a field swap to
    determine if request needs network byte order conversion.
    Thus by using swap, we can convert the request when
    required instead of duplicating it.

    In this commit,
    1. we remove the references to these elements as members of
    struct tipc_subscription and replace them with elements
    from struct tipc_subscr.
    2. provide new functions to convert the user request into
    network byte order.

    Acked-by: Ying Xue
    Reviewed-by: Jon Maloy
    Signed-off-by: Parthasarathy Bhuvaragan
    Signed-off-by: David S. Miller

    Parthasarathy Bhuvaragan
     

21 Nov, 2015

1 commit

  • The file name_distr.c currently contains three functions,
    named_cluster_distribute(), tipc_publ_subcscribe() and
    tipc_publ_unsubscribe() that all directly access fields in
    struct tipc_node. We want to eliminate such dependencies, so
    we move those functions to the file node.c and rename them to
    tipc_node_broadcast(), tipc_node_subscribe() and tipc_node_unsubscribe()
    respectively.

    Reviewed-by: Ying Xue
    Signed-off-by: Jon Maloy
    Signed-off-by: David S. Miller

    Jon Paul Maloy
     

05 May, 2015

1 commit

  • When a topology server accepts a connection request from its client,
    it allocates a connection instance and a tipc_subscriber structure
    object. The former is used to communicate with client, and the latter
    is often treated as a subscriber which manages all subscription events
    requested from a same client. When a topology server receives a request
    of subscribing name services from a client through the connection, it
    creates a tipc_subscription structure instance which is seen as a
    subscription recording what name services are subscribed. In order to
    manage all subscriptions from a same client, topology server links
    them into the subscrp_list of the subscriber. So subscriber and
    subscription completely represents different meanings respectively,
    but function names associated with them make us so confused that we
    are unable to easily tell which function is against subscriber and
    which is to subscription. So we want to eliminate the confusion by
    renaming them.

    Signed-off-by: Ying Xue
    Reviewed-by: Jon Maloy
    Signed-off-by: David S. Miller

    Ying Xue
     

18 Mar, 2015

1 commit

  • [ 28.531768] =============================================
    [ 28.532322] [ INFO: possible recursive locking detected ]
    [ 28.532322] 3.19.0+ #194 Not tainted
    [ 28.532322] ---------------------------------------------
    [ 28.532322] insmod/583 is trying to acquire lock:
    [ 28.532322] (&(&nseq->lock)->rlock){+.....}, at: [] tipc_nametbl_remove_publ+0x49/0x2e0 [tipc]
    [ 28.532322]
    [ 28.532322] but task is already holding lock:
    [ 28.532322] (&(&nseq->lock)->rlock){+.....}, at: [] tipc_nametbl_stop+0xfc/0x1f0 [tipc]
    [ 28.532322]
    [ 28.532322] other info that might help us debug this:
    [ 28.532322] Possible unsafe locking scenario:
    [ 28.532322]
    [ 28.532322] CPU0
    [ 28.532322] ----
    [ 28.532322] lock(&(&nseq->lock)->rlock);
    [ 28.532322] lock(&(&nseq->lock)->rlock);
    [ 28.532322]
    [ 28.532322] *** DEADLOCK ***
    [ 28.532322]
    [ 28.532322] May be due to missing lock nesting notation
    [ 28.532322]
    [ 28.532322] 3 locks held by insmod/583:
    [ 28.532322] #0: (net_mutex){+.+.+.}, at: [] register_pernet_subsys+0x1f/0x50
    [ 28.532322] #1: (&(&tn->nametbl_lock)->rlock){+.....}, at: [] tipc_nametbl_stop+0xb1/0x1f0 [tipc]
    [ 28.532322] #2: (&(&nseq->lock)->rlock){+.....}, at: [] tipc_nametbl_stop+0xfc/0x1f0 [tipc]
    [ 28.532322]
    [ 28.532322] stack backtrace:
    [ 28.532322] CPU: 1 PID: 583 Comm: insmod Not tainted 3.19.0+ #194
    [ 28.532322] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2007
    [ 28.532322] ffffffff82394460 ffff8800144cb928 ffffffff81792f3e 0000000000000007
    [ 28.532322] ffffffff82394460 ffff8800144cba28 ffffffff810a8080 ffff8800144cb998
    [ 28.532322] ffffffff810a4df3 ffff880013e9cb10 ffffffff82b0d330 ffff880013e9cb38
    [ 28.532322] Call Trace:
    [ 28.532322] [] dump_stack+0x4c/0x65
    [ 28.532322] [] __lock_acquire+0x740/0x1ca0
    [ 28.532322] [] ? __bfs+0x23/0x270
    [ 28.532322] [] ? check_irq_usage+0x96/0xe0
    [ 28.532322] [] ? __lock_acquire+0x1133/0x1ca0
    [ 28.532322] [] ? tipc_nametbl_remove_publ+0x49/0x2e0 [tipc]
    [ 28.532322] [] lock_acquire+0x9c/0x140
    [ 28.532322] [] ? tipc_nametbl_remove_publ+0x49/0x2e0 [tipc]
    [ 28.532322] [] _raw_spin_lock_bh+0x3f/0x50
    [ 28.532322] [] ? tipc_nametbl_remove_publ+0x49/0x2e0 [tipc]
    [ 28.532322] [] tipc_nametbl_remove_publ+0x49/0x2e0 [tipc]
    [ 28.532322] [] tipc_nametbl_stop+0x13e/0x1f0 [tipc]
    [ 28.532322] [] ? tipc_nametbl_stop+0x5/0x1f0 [tipc]
    [ 28.532322] [] tipc_init_net+0x13b/0x150 [tipc]
    [ 28.532322] [] ? tipc_init_net+0x5/0x150 [tipc]
    [ 28.532322] [] ops_init+0x4e/0x150
    [ 28.532322] [] ? trace_hardirqs_on+0xd/0x10
    [ 28.532322] [] register_pernet_operations+0xf3/0x190
    [ 28.532322] [] register_pernet_subsys+0x2e/0x50
    [ 28.532322] [] tipc_init+0x6a/0x1000 [tipc]
    [ 28.532322] [] ? 0xffffffffa0024000
    [ 28.532322] [] do_one_initcall+0x89/0x1c0
    [ 28.532322] [] ? kmem_cache_alloc_trace+0x50/0x1b0
    [ 28.532322] [] ? do_init_module+0x2b/0x200
    [ 28.532322] [] do_init_module+0x64/0x200
    [ 28.532322] [] load_module+0x12f3/0x18e0
    [ 28.532322] [] ? show_initstate+0x50/0x50
    [ 28.532322] [] SyS_init_module+0xd9/0x110
    [ 28.532322] [] sysenter_dispatch+0x7/0x1f

    Before tipc_purge_publications() calls tipc_nametbl_remove_publ() to
    remove a publication with a name sequence, the name sequence's lock
    is held. However, when tipc_nametbl_remove_publ() calling
    tipc_nameseq_remove_publ() to remove the publication, it first tries
    to query name sequence instance with the publication, and then holds
    the lock of the found name sequence. But as the lock may be already
    taken in tipc_purge_publications(), deadlock happens like above
    scenario demonstrated. As tipc_nameseq_remove_publ() doesn't grab name
    sequence's lock, the deadlock can be avoided if it's directly invoked
    by tipc_purge_publications().

    Fixes: 97ede29e80ee ("tipc: convert name table read-write lock to RCU")
    Signed-off-by: Ying Xue
    Reviewed-by: Erik Hugne
    Signed-off-by: David S. Miller

    Ying Xue
     

10 Feb, 2015

3 commits


06 Feb, 2015

1 commit

  • The structure 'tipc_port_list' is used to collect port numbers
    representing multicast destination socket on a receiving node.
    The list is not based on a standard linked list, and is in reality
    optimized for the uncommon case that there are more than one
    multicast destinations per node. This makes the list handling
    unecessarily complex, and as a consequence, even the socket
    multicast reception becomes more complex.

    In this commit, we replace 'tipc_port_list' with a new 'struct
    tipc_plist', which is based on a standard list. We give the new
    list stack (push/pop) semantics, someting that simplifies
    the implementation of the function tipc_sk_mcast_rcv().

    Reviewed-by: Ying Xue
    Signed-off-by: Jon Maloy
    Signed-off-by: David S. Miller

    Jon Paul Maloy
     

13 Jan, 2015

4 commits

  • If net namespace is supported in tipc, each namespace will be treated
    as a separate tipc node. Therefore, every namespace must own its
    private tipc node address. This means the "tipc_own_addr" global
    variable of node address must be moved to tipc_net structure to
    satisfy the requirement. It's turned out that users also can assign
    node address for every namespace.

    Signed-off-by: Ying Xue
    Tested-by: Tero Aho
    Reviewed-by: Jon Maloy
    Signed-off-by: David S. Miller

    Ying Xue
     
  • TIPC name table is used to store the mapping relationship between
    TIPC service name and socket port ID. When tipc supports namespace,
    it allows users to publish service names only owned by a certain
    namespace. Therefore, every namespace must have its private name
    table to prevent service names published to one namespace from being
    contaminated by other service names in another namespace. Therefore,
    The name table global variable (ie, nametbl) and its lock must be
    moved to tipc_net structure, and a parameter of namespace must be
    added for necessary functions so that they can obtain name table
    variable defined in tipc_net structure.

    Signed-off-by: Ying Xue
    Tested-by: Tero Aho
    Reviewed-by: Jon Maloy
    Signed-off-by: David S. Miller

    Ying Xue
     
  • TIPC broadcast link is statically established and its relevant states
    are maintained with the global variables: "bcbearer", "bclink" and
    "bcl". Allowing different namespace to own different broadcast link
    instances, these variables must be moved to tipc_net structure and
    broadcast link instances would be allocated and initialized when
    namespace is created.

    Signed-off-by: Ying Xue
    Tested-by: Tero Aho
    Reviewed-by: Jon Maloy
    Signed-off-by: David S. Miller

    Ying Xue
     
  • Global variables associated with node table are below:
    - node table list (node_htable)
    - node hash table list (tipc_node_list)
    - node table lock (node_list_lock)
    - node number counter (tipc_num_nodes)
    - node link number counter (tipc_num_links)

    To make node table support namespace, above global variables must be
    moved to tipc_net structure in order to keep secret for different
    namespaces. As a consequence, these variables are allocated and
    initialized when namespace is created, and deallocated when namespace
    is destroyed. After the change, functions associated with these
    variables have to utilize a namespace pointer to access them. So
    adding namespace pointer as a parameter of these functions is the
    major change made in the commit.

    Signed-off-by: Ying Xue
    Tested-by: Tero Aho
    Reviewed-by: Jon Maloy
    Signed-off-by: David S. Miller

    Ying Xue
     

10 Dec, 2014

1 commit

  • The commit fb9962f3cefe ("tipc: ensure all name sequences are properly
    protected with its lock") involves below errors:

    net/tipc/name_table.c:980 tipc_purge_publications() error: double lock 'spin_lock:&seq->lock'

    Reported-by: Dan Carpenter
    Signed-off-by: Ying Xue
    Signed-off-by: David S. Miller

    Ying Xue
     

09 Dec, 2014

7 commits

  • Convert tipc name table read-write lock to RCU. After this change,
    a new spin lock is used to protect name table on write side while
    RCU is applied on read side.

    Signed-off-by: Ying Xue
    Reviewed-by: Erik Hugne
    Reviewed-by: Jon Maloy
    Tested-by: Erik Hugne
    Signed-off-by: David S. Miller

    Ying Xue
     
  • When a list_head variable is seen as a new entry to be added to a
    list head, it's unnecessary to be initialized with INIT_LIST_HEAD().

    Signed-off-by: Ying Xue
    Reviewed-by: Erik Hugne
    Reviewed-by: Jon Maloy
    Tested-by: Erik Hugne
    Signed-off-by: David S. Miller

    Ying Xue
     
  • When tipc name sequence is published, name table lock is released
    before name sequence buffer is delivered to remote nodes through its
    underlying unicast links. However, when name sequence is withdrawn,
    the name table lock is held until the transmission of the removal
    message of name sequence is finished. During the process, node lock
    is nested in name table lock. To prevent node lock from being nested
    in name table lock, while withdrawing name, we should adopt the same
    locking policy of publishing name sequence: name table lock should
    be released before message is sent.

    Signed-off-by: Ying Xue
    Reviewed-by: Erik Hugne
    Reviewed-by: Jon Maloy
    Tested-by: Erik Hugne
    Signed-off-by: David S. Miller

    Ying Xue
     
  • As tipc_nametbl_lock is used to protect name_table structure, the lock
    must be held while all members of name_table structure are accessed.
    However, the lock is not obtained while a member of name_table
    structure - local_publ_count is read in tipc_nametbl_publish(), as
    a consequence, an inconsistent value of local_publ_count might be got.

    Signed-off-by: Ying Xue
    Reviewed-by: Erik Hugne
    Reviewed-by: Jon Maloy
    Tested-by: Erik Hugne
    Signed-off-by: David S. Miller

    Ying Xue
     
  • TIPC internally created a name table which is used to store name
    sequences. Now there is a read-write lock - tipc_nametbl_lock to
    protect the table, and each name sequence saved in the table is
    protected with its private lock. When a name sequence is inserted
    or removed to or from the table, its members might need to change.
    Therefore, in normal case, the two locks must be held while TIPC
    operates the table. However, there are still several places where
    we only hold tipc_nametbl_lock without proprerly obtaining name
    sequence lock, which might cause the corruption of name sequence.

    Signed-off-by: Ying Xue
    Reviewed-by: Erik Hugne
    Reviewed-by: Jon Maloy
    Tested-by: Erik Hugne
    Signed-off-by: David S. Miller

    Ying Xue
     
  • As TIPC subscriber server is terminated before name table, no user
    depends on subscription list of name sequence when name table is
    stopped. Therefore, all name sequences stored in name table should
    be released whatever their subscriptions lists are empty or not,
    otherwise, memory leak might happen.

    Signed-off-by: Ying Xue
    Reviewed-by: Erik Hugne
    Reviewed-by: Jon Maloy
    Tested-by: Erik Hugne
    Signed-off-by: David S. Miller

    Ying Xue
     
  • Name table locking policy is going to be adjusted from read-write
    lock protection to RCU lock protection in the future commits. But
    its essential precondition is to convert the allocation way of name
    table from static to dynamic mode.

    Signed-off-by: Ying Xue
    Reviewed-by: Erik Hugne
    Reviewed-by: Jon Maloy
    Tested-by: Erik Hugne
    Signed-off-by: David S. Miller

    Ying Xue
     

27 Nov, 2014

1 commit

  • The node subscribe infrastructure represents a virtual base class, so
    its users, such as struct tipc_port and struct publication, can derive
    its implemented functionalities. However, after the removal of struct
    tipc_port, struct publication is left as its only single user now. So
    defining an abstract infrastructure for one user becomes no longer
    reasonable. If corresponding new functions associated with the
    infrastructure are moved to name_table.c file, the node subscription
    infrastructure can be removed as well.

    Signed-off-by: Ying Xue
    Reviewed-by: Jon Maloy
    Signed-off-by: David S. Miller

    Ying Xue
     

25 Nov, 2014

1 commit


22 Nov, 2014

1 commit

  • Add TIPC_NL_NAME_TABLE_GET command to the new tipc netlink API.

    This command supports dumping the name table of all nodes.

    Netlink logical layout of name table response message:
    -> name table
    -> publication
    -> type
    -> lower
    -> upper
    -> scope
    -> node
    -> ref
    -> key

    Signed-off-by: Richard Alpe
    Reviewed-by: Erik Hugne
    Reviewed-by: Jon Maloy
    Acked-by: Ying Xue
    Signed-off-by: David S. Miller

    Richard Alpe
     

02 Sep, 2014

1 commit

  • TIPC name table updates are distributed asynchronously in a cluster,
    entailing a risk of certain race conditions. E.g., if two nodes
    simultaneously issue conflicting (overlapping) publications, this may
    not be detected until both publications have reached a third node, in
    which case one of the publications will be silently dropped on that
    node. Hence, we end up with an inconsistent name table.

    In most cases this conflict is just a temporary race, e.g., one
    node is issuing a publication under the assumption that a previous,
    conflicting, publication has already been withdrawn by the other node.
    However, because of the (rtt related) distributed update delay, this
    may not yet hold true on all nodes. The symptom of this failure is a
    syslog message: "tipc: Cannot publish {%u,%u,%u}, overlap error".

    In this commit we add a resiliency queue at the receiving end of
    the name table distributor. When insertion of an arriving publication
    fails, we retain it in this queue for a short amount of time, assuming
    that another update will arrive very soon and clear the conflict. If so
    happens, we insert the publication, otherwise we drop it.

    The (configurable) retention value defaults to 2000 ms. Knowing from
    experience that the situation described above is extremely rare, there
    is no risk that the queue will accumulate any large number of items.

    Signed-off-by: Erik Hugne
    Signed-off-by: Jon Maloy
    Acked-by: Ying Xue
    Signed-off-by: David S. Miller

    Erik Hugne
     

24 Aug, 2014

1 commit

  • We move the inline functions in the file port.h to socket.c, and modify
    their names accordingly.

    We move struct tipc_port and some macros to socket.h.

    Finally, we remove the file port.h.

    Signed-off-by: Jon Maloy
    Reviewed-by: Erik Hugne
    Reviewed-by: Ying Xue
    Signed-off-by: David S. Miller

    Jon Paul Maloy
     

01 May, 2014

1 commit

  • Commit 1bb8dce57f4d15233688c68990852a10eb1cd79f ("tipc: fix memory
    leak during module removal") introduced a memory leak issue: when
    name table is stopped, it's forgotten that publication instances are
    freed properly. Additionally the useless "continue" statement in
    tipc_nametbl_stop() is removed as well.

    Reported-by: Jason
    Signed-off-by: Ying Xue
    Acked-by: Erik Hugne
    Signed-off-by: David S. Miller

    Ying Xue
     

29 Apr, 2014

1 commit

  • Commit a89778d8baf19cd7e728d81121a294a06cedaad1 ("tipc: add support
    for link state subscriptions") introduced below possible deadlock
    scenario:

    CPU0 CPU1
    T0: tipc_publish() link_timeout()
    T1: tipc_nametbl_publish() [grab node lock]*
    T2: [grab nametbl write lock]* link_state_event()
    T3: named_cluster_distribute() link_activate()
    T4: [grab node lock]* tipc_node_link_up()
    T5: tipc_nametbl_publish()
    T6: [grab nametble write lock]*

    The opposite order of holding nametbl write lock and node lock on
    above two different paths may result in a deadlock. If we move the
    the delivery of named messages via link out of name nametbl lock,
    the reverse order of holding locks will be eliminated, as a result,
    the deadlock will be killed as well.

    Signed-off-by: Ying Xue
    Reviewed-by: Erik Hugne
    Signed-off-by: David S. Miller

    Ying Xue
     

07 Mar, 2014

1 commit

  • When the TIPC module is removed, the tasklet handler is disabled
    before all other subsystems. This will cause lingering publications
    in the name table because the node_down tasklets responsible to
    clean up publications from an unreachable node will never run.
    When the name table is shut down, these publications are detected
    and an error message is logged:
    tipc: nametbl_stop(): orphaned hash chain detected
    This is actually a memory leak, introduced with commit
    993b858e37b3120ee76d9957a901cca22312ffaa ("tipc: correct the order
    of stopping services at rmmod")

    Instead of just logging an error and leaking memory, we free
    the orphaned entries during nametable shutdown.

    Signed-off-by: Erik Hugne
    Reviewed-by: Jon Maloy
    Signed-off-by: David S. Miller

    Erik Hugne
     

22 Feb, 2014

1 commit

  • When tipc module is inserted, many tipc components are initialized
    one by one. During the initialization period, if one of them is
    failed, tipc_core_stop() will be called to stop all components
    whatever corresponding components are created or not. To avoid to
    release uncreated ones, relevant components have to add necessary
    enabled flags indicating whether they are created or not.

    But in the initialization stage, if one component is unsuccessfully
    created, we will just destroy successfully created components before
    the failed component instead of all components. All enabled flags
    defined in components, in turn, become redundant. Additionally it's
    also unnecessary to identify whether table.types is NULL in
    tipc_nametbl_stop() because name stable has been definitely created
    successfully when tipc_nametbl_stop() is called.

    Cc: Jon Maloy
    Cc: Erik Hugne
    Signed-off-by: Ying Xue
    Reviewed-by: Paul Gortmaker
    Signed-off-by: David S. Miller

    Ying Xue
     

17 Dec, 2013

1 commit


18 Jun, 2013

1 commit


28 Feb, 2013

1 commit

  • I'm not sure why, but the hlist for each entry iterators were conceived

    list_for_each_entry(pos, head, member)

    The hlist ones were greedy and wanted an extra parameter:

    hlist_for_each_entry(tpos, pos, head, member)

    Why did they need an extra pos parameter? I'm not quite sure. Not only
    they don't really need it, it also prevents the iterator from looking
    exactly like the list iterator, which is unfortunate.

    Besides the semantic patch, there was some manual work required:

    - Fix up the actual hlist iterators in linux/list.h
    - Fix up the declaration of other iterators based on the hlist ones.
    - A very small amount of places were using the 'node' parameter, this
    was modified to use 'obj->member' instead.
    - Coccinelle didn't handle the hlist_for_each_entry_safe iterator
    properly, so those had to be fixed up manually.

    The semantic patch which is mostly the work of Peter Senna Tschudin is here:

    @@
    iterator name hlist_for_each_entry, hlist_for_each_entry_continue, hlist_for_each_entry_from, hlist_for_each_entry_rcu, hlist_for_each_entry_rcu_bh, hlist_for_each_entry_continue_rcu_bh, for_each_busy_worker, ax25_uid_for_each, ax25_for_each, inet_bind_bucket_for_each, sctp_for_each_hentry, sk_for_each, sk_for_each_rcu, sk_for_each_from, sk_for_each_safe, sk_for_each_bound, hlist_for_each_entry_safe, hlist_for_each_entry_continue_rcu, nr_neigh_for_each, nr_neigh_for_each_safe, nr_node_for_each, nr_node_for_each_safe, for_each_gfn_indirect_valid_sp, for_each_gfn_sp, for_each_host;

    type T;
    expression a,c,d,e;
    identifier b;
    statement S;
    @@

    -T b;

    [akpm@linux-foundation.org: drop bogus change from net/ipv4/raw.c]
    [akpm@linux-foundation.org: drop bogus hunk from net/ipv6/raw.c]
    [akpm@linux-foundation.org: checkpatch fixes]
    [akpm@linux-foundation.org: fix warnings]
    [akpm@linux-foudnation.org: redo intrusive kvm changes]
    Tested-by: Peter Senna Tschudin
    Acked-by: Paul E. McKenney
    Signed-off-by: Sasha Levin
    Cc: Wu Fengguang
    Cc: Marcelo Tosatti
    Cc: Gleb Natapov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Sasha Levin
     

19 Sep, 2012

1 commit


20 Aug, 2012

2 commits


14 Jul, 2012

1 commit

  • The tipc_printf is renamed to tipc_snprintf, as the new name
    describes more what the function actually does. It is also
    changed to take a buffer and length parameter and return
    number of characters written to the buffer. All callers of
    this function that used to pass a print_buf are updated.

    Final removal of the struct print_buf itself will be done
    synchronously with the pending removal of the deprecated
    logging code that also was using it.

    Functions that build up a response message with a list of
    ports, nametable contents etc. are changed to return the number
    of characters written to the output buffer. This information
    was previously hidden in a field of the print_buf struct, and
    the number of chars written was fetched with a call to
    tipc_printbuf_validate. This function is removed since it
    is no longer referenced nor needed.

    A generic max size ULTRA_STRING_MAX_LEN is defined, named
    in keeping with the existing TIPC_TLV_ULTRA_STRING, and the
    various definitions in port, link and nametable code that
    largely duplicated this information are removed. This means
    that amount of link statistics that can be returned is now
    increased from 2k to 32k.

    The buffer overflow check is now done just before the reply
    message is passed over netlink or TIPC to a remote node and
    the message indicating a truncated buffer is changed to a less
    dramatic one (less CAPS), placed at the end of the message.

    Signed-off-by: Erik Hugne
    Signed-off-by: Jon Maloy
    Signed-off-by: Paul Gortmaker

    Erik Hugne