1. 24 Apr, 2014 1 commit
  2. 28 Mar, 2013 1 commit
  3. 13 Sep, 2012 1 commit
    • Eric W. Biederman's avatar
      scsi_netlink: Remove dead and buggy code · 8289bab1
      Eric W. Biederman authored
      The scsi netlink code confuses the netlink port id with a process id,
      going so far as to read NETLINK_CREDS(skb)->pid instead of the correct
      NETLINK_CB(skb).pid.  Fortunately it does not matter because nothing
      registers to respond to scsi netlink requests.
      
      The only interesting use of the scsi_netlink interface is
      fc_host_post_vendor_event which sends a netlink multicast message.
      
      Since nothing registers to handle scsi netlink messages kill all of the
      registration logic, while retaining the same error handling behavior
      preserving the userspace visible behavior and removing all of the
      confused code that thought a netlink port id was a process id.
      
      This was tested with a kernel allyesconfig build which had no problems.
      
      Cc: James Bottomley <James.Bottomley@parallels.com>
      Cc: James Smart <James.Smart@Emulex.Com>
      Signed-off-by: default avatar"Eric W. Biederman" <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      8289bab1
  4. 08 Sep, 2012 1 commit
  5. 29 Jun, 2012 1 commit
    • Pablo Neira Ayuso's avatar
      netlink: add netlink_kernel_cfg parameter to netlink_kernel_create · a31f2d17
      Pablo Neira Ayuso authored
      This patch adds the following structure:
      
      struct netlink_kernel_cfg {
              unsigned int    groups;
              void            (*input)(struct sk_buff *skb);
              struct mutex    *cb_mutex;
      };
      
      That can be passed to netlink_kernel_create to set optional configurations
      for netlink kernel sockets.
      
      I've populated this structure by looking for NULL and zero parameters at the
      existing code. The remaining parameters that always need to be set are still
      left in the original interface.
      
      That includes optional parameters for the netlink socket creation. This allows
      easy extensibility of this interface in the future.
      
      This patch also adapts all callers to use this new interface.
      Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      a31f2d17
  6. 05 Jan, 2012 1 commit
  7. 31 Oct, 2011 1 commit
  8. 31 Mar, 2011 1 commit
  9. 01 Nov, 2010 1 commit
  10. 30 Mar, 2010 1 commit
    • Tejun Heo's avatar
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo authored
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: default avatarTejun Heo <tj@kernel.org>
      Guess-its-ok-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  11. 04 Dec, 2009 1 commit
  12. 23 Oct, 2008 1 commit
  13. 03 Oct, 2008 1 commit
    • James Smart's avatar
      [SCSI] scsi_netlink: Add transport and LLD recieve and event support · 22447be7
      James Smart authored
      This patch adds scsi netlink recieve and event support for transport
      and scsi LLDD's.  It is a reimplementation of the patch posted last
      week by David Somayajulu.
      http://marc.info/?l=linux-scsi&m=121745486221819&w=2
      
      There are a few things done differently:
      
      - Transport support is included
      
      - Event delivery is included
      
      - The vendor message is now its own unique message type, considered
        part of the generic "SCSI Transport".
      
      - LLDD entry points are now registered rather than included in the
        scsi_host_template.
      
        Background: When I started to implement the event handler via template,
        I had to either: muck up scsi_add_host and scsi_remove_host;  or have
        the event handler search all possible shosts. Neither was acceptable.
        Moving to a registration solves this, and also limits the scope of
        the changes to something that could be backported to a distro without
        breaking an already-released-distro kabi. However, I admit it isn't
        as elegant, as the passing of the LLDD host template in the
        registration and the complexity around dynamic add/remove shows.
      
      - The receive path was augmented to require a unique identifier for
        the LLDD before the message was allowed to be handed off to the
        driver. Given how quickly very fatal errors occur if there's msg
        mismatches (which I saw in testing my own tools :), I believe this
        to be a very good thing. The id plays off the vendor id scheme already
        introduced for the vendor unique event messages used by FC.
        Additionally, the id use as the basis of the registration/deregistration.
      
      - Send assist functions, for both the transport and LLDDs are included.
      
      [fujita.tomonori@lab.ntt.co.jp: fix missing cast]
      Signed-off-by: default avatarJames Smart <james.smart@emulex.com>
      Signed-off-by: default avatarJames Bottomley <James.Bottomley@HansenPartnership.com>
      22447be7
  14. 27 Jul, 2008 1 commit
  15. 28 Jan, 2008 1 commit
  16. 11 Jan, 2008 1 commit
  17. 10 Oct, 2007 2 commits
    • Denis V. Lunev's avatar
      [NET]: make netlink user -> kernel interface synchronious · cd40b7d3
      Denis V. Lunev authored
      This patch make processing netlink user -> kernel messages synchronious.
      This change was inspired by the talk with Alexey Kuznetsov about current
      netlink messages processing. He says that he was badly wrong when introduced 
      asynchronious user -> kernel communication.
      
      The call netlink_unicast is the only path to send message to the kernel
      netlink socket. But, unfortunately, it is also used to send data to the
      user.
      
      Before this change the user message has been attached to the socket queue
      and sk->sk_data_ready was called. The process has been blocked until all
      pending messages were processed. The bad thing is that this processing
      may occur in the arbitrary process context.
      
      This patch changes nlk->data_ready callback to get 1 skb and force packet
      processing right in the netlink_unicast.
      
      Kernel -> user path in netlink_unicast remains untouched.
      
      EINTR processing for in netlink_run_queue was changed. It forces rtnl_lock
      drop, but the process remains in the cycle until the message will be fully
      processed. So, there is no need to use this kludges now.
      Signed-off-by: default avatarDenis V. Lunev <den@openvz.org>
      Acked-by: default avatarAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      cd40b7d3
    • Eric W. Biederman's avatar
      [NET]: Support multiple network namespaces with netlink · b4b51029
      Eric W. Biederman authored
      Each netlink socket will live in exactly one network namespace,
      this includes the controlling kernel sockets.
      
      This patch updates all of the existing netlink protocols
      to only support the initial network namespace.  Request
      by clients in other namespaces will get -ECONREFUSED.
      As they would if the kernel did not have the support for
      that netlink protocol compiled in.
      
      As each netlink protocol is updated to be multiple network
      namespace safe it can register multiple kernel sockets
      to acquire a presence in the rest of the network namespaces.
      
      The implementation in af_netlink is a simple filter implementation
      at hash table insertion and hash table look up time.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      b4b51029
  18. 25 Apr, 2007 2 commits
  19. 02 Sep, 2006 1 commit