1. 27 6月, 2017 2 次提交
  2. 04 5月, 2017 1 次提交
  3. 22 4月, 2017 1 次提交
  4. 20 4月, 2017 1 次提交
    • R
      ligtnvm: fix double blk_put_queue on same queue · 75ba4ada
      Rakesh Pandit 提交于
      On an error path in NVM_DEV_CREATE ioctl blk_put_queue is being called
      twice: one via blk_cleanup_queue and another via put_disk.  Straight fix
      seems to remove queue pointer so that disk_release never ends up caling
      blk_put_queue again.
      
        [  391.808827] WARNING: CPU: 1 PID: 1250 at lib/refcount.c:128 refcount_sub_and_test+0x70/0x80
        [  391.808830] refcount_t: underflow; use-after-free.
        [ 391.808832] Modules linked in: nf_conntrack_netbios_ns............
        [  391.809052] CPU: 1 PID: 1250 Comm: nvme Not tainted.........
        [  391.809057] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
                   BIOS rel-1.7.5-0-ge51488c-20140602_164612-nilsson.home.kraxel.org 04/01/2014
        [  391.809060] Call Trace:
        [  391.809079]  dump_stack+0x63/0x86
        [  391.809094]  __warn+0xcb/0xf0
        [  391.809103]  warn_slowpath_fmt+0x5f/0x80
        [  391.809118]  refcount_sub_and_test+0x70/0x80
        [  391.809125]  refcount_dec_and_test+0x11/0x20
        [  391.809136]  kobject_put+0x1f/0x60
        [  391.809149]  blk_put_queue+0x15/0x20
        [  391.809159]  disk_release+0xae/0xf0
        [  391.809172]  device_release+0x32/0x90
        [  391.809184]  kobject_release+0x6a/0x170
        [  391.809196]  kobject_put+0x2f/0x60
        [  391.809206]  put_disk+0x17/0x20
        [  391.809219]  nvm_ioctl_dev_create.isra.16+0x897/0xa30
        [  391.809236]  nvm_ctl_ioctl+0x23c/0x4c0
        [  391.809248]  do_vfs_ioctl+0xa3/0x5f0
        [  391.809258]  SyS_ioctl+0x79/0x90
        [  391.809271]  entry_SYSCALL_64_fastpath+0x1a/0xa9
        [  391.809280] RIP: 0033:0x7f5d3ef363c7
        [  391.809286] RSP: 002b:00007ffc72ed8d78 EFLAGS: 00000206 ORIG_RAX: 0000000000000010
        [  391.809296] RAX: ffffffffffffffda RBX: 00007ffc72edb552 RCX: 00007f5d3ef363c7
        [  391.809301] RDX: 00007ffc72ed8d90 RSI: 0000000040804c22 RDI: 0000000000000003
        [  391.809306] RBP: 0000000000000001 R08: 0000000000000020 R09: 0000000000000001
        [  391.809311] R10: 000000000000053f R11: 0000000000000206 R12: 0000000000000000
        [  391.809316] R13: 0000000000000000 R14: 00007ffc72edb58d R15: 00007ffc72edb581
      Signed-off-by: NRakesh Pandit <rakesh@tuxera.com>
      Reviewed-by: NMatias Bjørling <matias@cnexlabs.com>
      Fixes: 7d1ef2f4 "lightnvm: fix cleanup order of disk on init error"
      Signed-off-by: NJens Axboe <axboe@fb.com>
      75ba4ada
  5. 17 4月, 2017 8 次提交
  6. 15 2月, 2017 2 次提交
  7. 31 1月, 2017 10 次提交
  8. 30 11月, 2016 11 次提交
  9. 10 11月, 2016 1 次提交
    • P
      lightnvm: make core.c explicitly non-modular · 389b2a1c
      Paul Gortmaker 提交于
      The Kconfig currently controlling compilation of this code is:
      
      drivers/lightnvm/Kconfig:menuconfig NVM
      drivers/lightnvm/Kconfig:       bool "Open-Channel SSD target support"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      Since module_misc_driver translates to device_initcall in the non-modular
      case, the init ordering remains unchanged with this commit.
      
      We also delete the MODULE_LICENSE tag etc. since all that information
      is already contained at the top of the file in the comments.
      
      We replace module.h with moduleparam.h because this file still uses
      module params to control behaviour.
      
      Also note that MODULE_ALIAS is a no-op for non-modular code.
      
      Cc: Matias Bjorling <mb@lightnvm.io>
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      389b2a1c
  10. 21 9月, 2016 3 次提交
    • S
      lightnvm: expose device geometry through sysfs · 40267efd
      Simon A. F. Lund 提交于
      For a host to access an Open-Channel SSD, it has to know its geometry,
      so that it writes and reads at the appropriate device bounds.
      
      Currently, the geometry information is kept within the kernel, and not
      exported to user-space for consumption. This patch exposes the
      configuration through sysfs and enables user-space libraries, such as
      liblightnvm, to use the sysfs implementation to get the geometry of an
      Open-Channel SSD.
      
      The sysfs entries are stored within the device hierarchy, and can be
      found using the "lightnvm" device type.
      
      An example configuration looks like this:
      
      /sys/class/nvme/
      └── nvme0n1
         ├── capabilities: 3
         ├── device_mode: 1
         ├── erase_max: 1000000
         ├── erase_typ: 1000000
         ├── flash_media_type: 0
         ├── media_capabilities: 0x00000001
         ├── media_type: 0
         ├── multiplane: 0x00010101
         ├── num_blocks: 1022
         ├── num_channels: 1
         ├── num_luns: 4
         ├── num_pages: 64
         ├── num_planes: 1
         ├── page_size: 4096
         ├── prog_max: 100000
         ├── prog_typ: 100000
         ├── read_max: 10000
         ├── read_typ: 10000
         ├── sector_oob_size: 0
         ├── sector_size: 4096
         ├── media_manager: gennvm
         ├── ppa_format: 0x380830082808001010102008
         ├── vendor_opcode: 0
         ├── max_phys_secs: 64
         └── version: 1
      Signed-off-by: NSimon A. F. Lund <slund@cnexlabs.com>
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      40267efd
    • M
      lightnvm: control life of nvm_dev in driver · b0b4e09c
      Matias Bjørling 提交于
      LightNVM compatible device drivers does not have a method to expose
      LightNVM specific sysfs entries.
      
      To enable LightNVM sysfs entries to be exposed, lightnvm device
      drivers require a struct device to attach it to. To allow both the
      actual device driver and lightnvm sysfs entries to coexist, the device
      driver tracks the lifetime of the nvm_dev structure.
      
      This patch refactors NVMe and null_blk to handle the lifetime of struct
      nvm_dev, which eliminates the need for struct gendisk when a lightnvm
      compatible device is provided.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      b0b4e09c
    • M
      nvme: refactor namespaces to support non-gendisk devices · ac81bfa9
      Matias Bjørling 提交于
      With LightNVM enabled namespaces, the gendisk structure is not exposed
      to the user. This prevents LightNVM users from accessing the NVMe device
      driver specific sysfs entries, and LightNVM namespace geometry.
      
      Refactor the revalidation process, so that a namespace, instead of a
      gendisk, is revalidated. This later allows patches to wire up the
      sysfs entries up to a non-gendisk namespace.
      Signed-off-by: NMatias Bjørling <m@bjorling.me>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      ac81bfa9