From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754074AbbDHL3X (ORCPT ); Wed, 8 Apr 2015 07:29:23 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:23580 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751392AbbDHL3V (ORCPT ); Wed, 8 Apr 2015 07:29:21 -0400 X-AuditID: cbfee61a-f79516d000006302-05-5525110e88d7 From: Krzysztof Opasiak To: balbi@ti.com, gregkh@linuxfoundation.org, jlbec@evilplan.org Cc: andrzej.p@samsung.com, m.szyprowski@samsung.com, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Krzysztof Opasiak Subject: [PATCH 0/5] Ensure that lun ids are contiguous Date: Wed, 08 Apr 2015 13:28:43 +0200 Message-id: <1428492528-11993-1-git-send-email-k.opasiak@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpgluLIzCtJLcpLzFFi42I5/e+xoC6foGqowexeE4tZL9tZLA7er7do XryezeLkuW8sFrcnTmOz2Py9g83i8q45bBaLlrUyW6w9cpfdgdPj6cUgj/1z17B79G1Zxehx /MZ2Jo/Pm+QCWKO4bFJSczLLUov07RK4MhZsvMBW8JW34n2PdQPjc64uRg4OCQETibdbhbsY OYFMMYkL99azdTFycQgJTGeUePS6Fcr5xSjR9u8SK0gDm4C+xLxdoiCmiICDxJkdRSAlzALb GCWe7pjBDjJIWMBc4teUBywgNouAqsSOxQtZQWxeAVeJtQdXMUPsVZCYM8lmAiP3AkaGVYyi qQXJBcVJ6bmGesWJucWleel6yfm5mxjB4fJMagfjygaLQ4wCHIxKPLwCi1VChVgTy4orcw8x SnAwK4nwnuFSDRXiTUmsrEotyo8vKs1JLT7EKM3BoiTOO0dXLlRIID2xJDU7NbUgtQgmy8TB KdXAGHNy3dQEKTnVhkXxvj27lsyO016ye8aT5XMXLubT+GOj2FXLwmFs/HLetdRX6ad3hOtP m3gh6806c9loBdP553Rebbmz8+b39Cf/bbwqWpzDgzxXXTTRyp7sclSowPzH7XrnoGX6SyfM /LHR0sok7+SlN7cDfq4oCfzGsVxsRfm75St9X/6vmqXEUpyRaKjFXFScCADq0ha0EwIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear list, This series fix configfs interface for mass storage function. According to mass storage specification[1]: "Logical Unit Numbers on the device shall be numbered contiguously starting from LUN 0 to a maximum LUN of 15 (Fh)." Currently configfs interface allows to create LUNs with arbitrary ids what causes problems with some host side mass storage drivers. This patch extends configfs interface with unlocked version of configfs_depend_item() which should be used only in configfs callbacks. This allows to protect from removing lun directory from the middle of id space. Example: as is: $ mkdir mass_storage.name $ mkdir lun.3 $ mkdir lun.5 $ rmdir lun.3 After this series: $ mkdir mass_storage.name $ mkdir lun.3 mkdir: cannot create directory 'lun.3': Invalid argument $ mkdir lun.1 $ mkdir lun.2 $ rmdir lun.1 rmdir: failed to remove 'lun.1': Device or resource busy $ rmdir lun.2 $ rmdir lun.1 -- Best regards, Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics Krzysztof Opasiak (5): fs: configfs: Fix typo in comment fs: configfs: Add unlocked version of configfs_depend_item() usb: gadget: mass_storage: Store lun_opts in fsg_opts usb: gadget: mass_storage: Ensure that lun ids are contiguous Documentation: ABI: Fix documentation for mass_storage function .../ABI/testing/configfs-usb-gadget-mass-storage | 7 +++- drivers/usb/gadget/function/f_mass_storage.c | 40 ++++++++++++++++++-- drivers/usb/gadget/function/f_mass_storage.h | 1 + fs/configfs/dir.c | 31 ++++++++++++++- include/linux/configfs.h | 9 +++++ 5 files changed, 82 insertions(+), 6 deletions(-) -- 1.7.9.5 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Krzysztof Opasiak Subject: [PATCH 0/5] Ensure that lun ids are contiguous Date: Wed, 08 Apr 2015 13:28:43 +0200 Message-ID: <1428492528-11993-1-git-send-email-k.opasiak@samsung.com> Return-path: Sender: linux-api-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: balbi-l0cyMroinI0@public.gmane.org, gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org, jlbec-aKy9MeLSZ9dg9hUCZPvPmw@public.gmane.org Cc: andrzej.p-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, m.szyprowski-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org, linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Krzysztof Opasiak List-Id: linux-api@vger.kernel.org Dear list, This series fix configfs interface for mass storage function. According to mass storage specification[1]: "Logical Unit Numbers on the device shall be numbered contiguously starting from LUN 0 to a maximum LUN of 15 (Fh)." Currently configfs interface allows to create LUNs with arbitrary ids what causes problems with some host side mass storage drivers. This patch extends configfs interface with unlocked version of configfs_depend_item() which should be used only in configfs callbacks. This allows to protect from removing lun directory from the middle of id space. Example: as is: $ mkdir mass_storage.name $ mkdir lun.3 $ mkdir lun.5 $ rmdir lun.3 After this series: $ mkdir mass_storage.name $ mkdir lun.3 mkdir: cannot create directory 'lun.3': Invalid argument $ mkdir lun.1 $ mkdir lun.2 $ rmdir lun.1 rmdir: failed to remove 'lun.1': Device or resource busy $ rmdir lun.2 $ rmdir lun.1 -- Best regards, Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics Krzysztof Opasiak (5): fs: configfs: Fix typo in comment fs: configfs: Add unlocked version of configfs_depend_item() usb: gadget: mass_storage: Store lun_opts in fsg_opts usb: gadget: mass_storage: Ensure that lun ids are contiguous Documentation: ABI: Fix documentation for mass_storage function .../ABI/testing/configfs-usb-gadget-mass-storage | 7 +++- drivers/usb/gadget/function/f_mass_storage.c | 40 ++++++++++++++++++-- drivers/usb/gadget/function/f_mass_storage.h | 1 + fs/configfs/dir.c | 31 ++++++++++++++- include/linux/configfs.h | 9 +++++ 5 files changed, 82 insertions(+), 6 deletions(-) -- 1.7.9.5