1. 19 10月, 2017 1 次提交
    • B
      configfs: make ci_type field, some pointers and function arguments const · aa293583
      Bhumika Goyal 提交于
      The ci_type field of the config_item structure do not modify the fields
      of the config_item_type structure it points to. And the other pointers
      initialized with ci_type do not modify the fields as well.
      So, make the ci_type field and the pointers initialized with ci_type
      as const.
      
      Make the struct config_item_type *type function argument of functions
      config_{item/group}_init_type_name const as the argument in both the
      functions is only stored in the ci_type field of a config_item structure
      which is now made const.
      Make the argument of configfs_register_default_group const as it is
      only passed to the argument of the function config_group_init_type_name
      which is now const.
      Signed-off-by: NBhumika Goyal <bhumirks@gmail.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      aa293583
  2. 09 5月, 2016 1 次提交
  3. 03 5月, 2016 1 次提交
  4. 14 3月, 2016 1 次提交
  5. 06 3月, 2016 1 次提交
  6. 23 1月, 2016 1 次提交
    • A
      wrappers for ->i_mutex access · 5955102c
      Al Viro 提交于
      parallel to mutex_{lock,unlock,trylock,is_locked,lock_nested},
      inode_foo(inode) being mutex_foo(&inode->i_mutex).
      
      Please, use those for access to ->i_mutex; over the coming cycle
      ->i_mutex will become rwsem, with ->lookup() done with it held
      only shared.
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      5955102c
  7. 04 1月, 2016 1 次提交
    • P
      configfs: implement binary attributes · 03607ace
      Pantelis Antoniou 提交于
      ConfigFS lacked binary attributes up until now. This patch
      introduces support for binary attributes in a somewhat similar
      manner of sysfs binary attributes albeit with changes that
      fit the configfs usage model.
      
      Problems that configfs binary attributes fix are everything that
      requires a binary blob as part of the configuration of a resource,
      such as bitstream loading for FPGAs, DTBs for dynamically created
      devices etc.
      
      Look at Documentation/filesystems/configfs/configfs.txt for internals
      and howto use them.
      
      This patch is against linux-next as of today that contains
      Christoph's configfs rework.
      Signed-off-by: NPantelis Antoniou <pantelis.antoniou@konsulko.com>
      [hch: folded a fix from Geert Uytterhoeven <geert+renesas@glider.be>]
      [hch: a few tiny updates based on review feedback]
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      03607ace
  8. 21 12月, 2015 4 次提交
    • K
      fs: configfs: Add unlocked version of configfs_depend_item() · d79d75b5
      Krzysztof Opasiak 提交于
      This change is necessary for the SCSI target usb gadget composed with
      configfs. In this case configfs will be used for two different purposes:
      to compose a usb gadget and to configure the target part. If an instance
      of tcm function is created in $CONFIGFS_ROOT/usb_gadget/<gadget>/functions
      a tpg can be created in $CONFIGFS_ROOT/target/usb_gadget/<wwn>/, but after
      a tpg is created the tcm function must not be removed until its
      corresponding tpg is gone. While the configfs_depend/undepend_item() are
      meant exactly for creating this kind of dependencies, they are not suitable
      if the other kernel subsystem happens to be another subsystem in configfs,
      so this patch adds unlocked versions meant for configfs callbacks.
      
      Above description has been provided by:
      Andrzej Pietrasiewicz <andrzej.p@samsung.com>
      
      In configfs_depend_item() we have to consider two possible cases:
      
      1) When we are called to depend another item in the same subsystem
         as caller
      	In this case we should skip locking configfs root as we know
      	that configfs is in valid state and our subsystem will not
      	be unregistered during this call.
      
      2) When we are called to depend item in different subsystem than
         our caller
      	In this case we are also sure that configfs is in valid state
      	but we have to lock root of configfs to avoid unregistration
      	of target's subsystem. As it is other than caller's subsystem,
      	there may be nothing what protects us against unregistration
      	of that subsystem.
      Signed-off-by: NKrzysztof Opasiak <k.opasiak@samsung.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      d79d75b5
    • K
      fs: configfs: Factor out configfs_find_subsys_dentry() · 9a70adff
      Krzysztof Opasiak 提交于
      configfs_depend_item() is quite complicated and should
      be split up into smaller functions. This also allow to
      share this code with other functions.
      Signed-off-by: NKrzysztof Opasiak <k.opasiak@samsung.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9a70adff
    • K
      fs: configfs: Factor out configfs_do_depend_item() · 9fb434e7
      Krzysztof Opasiak 提交于
      configfs_depend_item() is quite complicated and should
      be split up into smaller functions. This also allow to
      share this code with other functions.
      Signed-off-by: NKrzysztof Opasiak <k.opasiak@samsung.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9fb434e7
    • K
      fs: configfs: Drop unused parameter from configfs_undepend_item() · 9a9e3415
      Krzysztof Opasiak 提交于
      subsys parameter is never used by configfs_undepend_item()
      so there is no point in passing it to this function.
      Signed-off-by: NKrzysztof Opasiak <k.opasiak@samsung.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Christoph Hellwig <hch@lst.de>
      Signed-off-by: NNicholas Bellinger <nab@linux-iscsi.org>
      9a9e3415
  9. 21 11月, 2015 1 次提交
    • D
      configfs: allow dynamic group creation · 5cf6a51e
      Daniel Baluta 提交于
      This patchset introduces IIO software triggers, offers a way of configuring
      them via configfs and adds the IIO hrtimer based interrupt source to be used
      with software triggers.
      
      The architecture is now split in 3 parts, to remove all IIO trigger specific
      parts from IIO configfs core:
      
      (1) IIO configfs - creates the root of the IIO configfs subsys.
      (2) IIO software triggers - software trigger implementation, dynamically
          creating /config/iio/triggers group.
      (3) IIO hrtimer trigger - is the first interrupt source for software triggers
          (with syfs to follow). Each trigger type can implement its own set of
          attributes.
      
      Lockdep seems to be happy with the locking in configfs patch.
      
      This patch (of 5):
      
      We don't want to hardcode default groups at subsystem
      creation time. We export:
      	* configfs_register_group
      	* configfs_unregister_group
      to allow drivers to programatically create/destroy groups
      later, after module init time.
      
      This is needed for IIO configfs support.
      
      (akpm: the other 4 patches to be merged via the IIO tree)
      Signed-off-by: NDaniel Baluta <daniel.baluta@intel.com>
      Suggested-by: NLars-Peter Clausen <lars@metafoo.de>
      Reviewed-by: NChristoph Hellwig <hch@lst.de>
      Acked-by: NJoel Becker <jlbec@evilplan.org>
      Cc: Hartmut Knaack <knaack.h@gmx.de>
      Cc: Octavian Purdila <octavian.purdila@intel.com>
      Cc: Paul Bolle <pebolle@tiscali.nl>
      Cc: Adriana Reus <adriana.reus@intel.com>
      Cc: Cristina Opriceana <cristina.opriceana@gmail.com>
      Cc: Peter Meerwald <pmeerw@pmeerw.net>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      5cf6a51e
  10. 16 4月, 2015 2 次提交
  11. 18 2月, 2015 2 次提交
  12. 20 11月, 2014 1 次提交
  13. 05 6月, 2014 2 次提交
  14. 22 11月, 2013 1 次提交
    • J
      configfs: fix race between dentry put and lookup · 76ae281f
      Junxiao Bi 提交于
      A race window in configfs, it starts from one dentry is UNHASHED and end
      before configfs_d_iput is called.  In this window, if a lookup happen,
      since the original dentry was UNHASHED, so a new dentry will be
      allocated, and then in configfs_attach_attr(), sd->s_dentry will be
      updated to the new dentry.  Then in configfs_d_iput(),
      BUG_ON(sd->s_dentry != dentry) will be triggered and system panic.
      
      sys_open:                     sys_close:
       ...                           fput
                                      dput
                                       dentry_kill
                                        __d_drop <--- dentry unhashed here,
                                                 but sd->dentry still point
                                                 to this dentry.
      
       lookup_real
        configfs_lookup
         configfs_attach_attr---> update sd->s_dentry
                                  to new allocated dentry here.
      
                                         d_kill
                                           configfs_d_iput <--- BUG_ON(sd->s_dentry != dentry)
                                                           triggered here.
      
      To fix it, change configfs_d_iput to not update sd->s_dentry if
      sd->s_count > 2, that means there are another dentry is using the sd
      beside the one that is going to be put.  Use configfs_dirent_lock in
      configfs_attach_attr to sync with configfs_d_iput.
      
      With the following steps, you can reproduce the bug.
      
      1. enable ocfs2, this will mount configfs at /sys/kernel/config and
         fill configure in it.
      
      2. run the following script.
      	while [ 1 ]; do cat /sys/kernel/config/cluster/$your_cluster_name/idle_timeout_ms > /dev/null; done &
      	while [ 1 ]; do cat /sys/kernel/config/cluster/$your_cluster_name/idle_timeout_ms > /dev/null; done &
      Signed-off-by: NJunxiao Bi <junxiao.bi@oracle.com>
      Cc: Joel Becker <jlbec@evilplan.org>
      Cc: Al Viro <viro@zeniv.linux.org.uk>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      76ae281f
  15. 16 11月, 2013 1 次提交
  16. 14 7月, 2013 1 次提交
  17. 29 6月, 2013 1 次提交
  18. 23 2月, 2013 1 次提交
  19. 22 2月, 2013 1 次提交
  20. 18 12月, 2012 1 次提交
  21. 14 7月, 2012 1 次提交
    • A
      stop passing nameidata to ->lookup() · 00cd8dd3
      Al Viro 提交于
      Just the flags; only NFS cares even about that, but there are
      legitimate uses for such argument.  And getting rid of that
      completely would require splitting ->lookup() into a couple
      of methods (at least), so let's leave that alone for now...
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      00cd8dd3
  22. 21 3月, 2012 4 次提交
  23. 04 1月, 2012 3 次提交
  24. 28 5月, 2011 1 次提交
  25. 26 5月, 2011 1 次提交
  26. 18 5月, 2011 2 次提交
    • J
      configfs: Fix race between configfs_readdir() and configfs_d_iput() · 24307aa1
      Joel Becker 提交于
      configfs_readdir() will use the existing inode numbers of inodes in the
      dcache, but it makes them up for attribute files that aren't currently
      instantiated.  There is a race where a closing attribute file can be
      tearing down at the same time as configfs_readdir() is trying to get its
      inode number.
      
      We want to get the inode number of open attribute files, because they
      should match while instantiated.  We can't lock down the transition
      where dentry->d_inode is set to NULL, so we just check for NULL there.
      We can, however, ensure that an inode we find isn't iput() in
      configfs_d_iput() until after we've accessed it.
      Signed-off-by: NJoel Becker <jlbec@evilplan.org>
      24307aa1
    • J
      configfs: Don't try to d_delete() negative dentries. · df7f9967
      Joel Becker 提交于
      When configfs is faking mkdir() on its subsystem or default group
      objects, it starts by adding a negative dentry.  It then tries to
      instantiate the group.  If that should fail, it must clean up after
      itself.
      
      I was using d_delete() here, but configfs_attach_group() promises to
      return an empty dentry on error.  d_delete() explodes with the entry
      dentry.  Let's try d_drop() instead.  The unhashing is what we want for
      our dentry.
      Signed-off-by: NJoel Becker <jlbec@evilplan.org>
      df7f9967
  27. 31 3月, 2011 1 次提交
  28. 13 1月, 2011 1 次提交