Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756074AbbDIQSn (ORCPT ); Thu, 9 Apr 2015 12:18:43 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:46530 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753196AbbDIQSl (ORCPT ); Thu, 9 Apr 2015 12:18:41 -0400 X-AuditID: cbfee61a-f79516d000006302-29-5526a65fe62e 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 v3 0/4] Ensure that lun ids are contiguous Date: Thu, 09 Apr 2015 18:18:06 +0200 Message-id: <1428596290-23637-1-git-send-email-k.opasiak@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkluLIzCtJLcpLzFFi42I5/e+xgG78MrVQg6WTpSxmvWxnsTh4v96i efF6NouT576xWNyeOI3NYvP3DjaLy7vmsFksWtbKbLH2yF12B06PpxeDPPbPXcPu0bdlFaPH 8RvbmTw+b5ILYI3isklJzcksSy3St0vgypg74yVbwS2BinXr9rA2MHbwdjFyckgImEhsvrSG CcIWk7hwbz1bFyMXh5DAIkaJFc3XmSGcX4wShxY1AjkcHGwC+hLzdomCmCICDhJndhSBlDAL bGOUeLpjBjvIIGEBK4ljtxeBlbMIqEo8uhkKEuYVcJW4OvMYC0hYQkBBYs4kmwmM3AsYGVYx iqYWJBcUJ6XnGuoVJ+YWl+al6yXn525iBAfMM6kdjCsbLA4xCnAwKvHwvvimGirEmlhWXJl7 iFGCg1lJhPfjQrVQId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rxzdOVChQTSE0tSs1NTC1KLYLJM HJxSDYwsDx6t5Lz1I2uVr2+LpptTwbmV3e8fvOZOU5sec6O6Rthjp2t5qsO/dsMt9kskntTx BJYtnBHg2CH8aWXmjTV5nnGbpzxQ/3ZZS32G1pUbRqc72fgUK9d6rJoX9a3qWWB1yoMTQW3z lxX55U7ZfZvn0IZFPk+3ls+1vDGHq/JC7qKUsnvLHRKUWIozEg21mIuKEwGKcFMrFAIAAA== Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2310 Lines: 78 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 Footnotes: 1 - http://www.usb.org/developers/docs/devclass_docs/usbmassbulk_10.pdf -- Best regards, Krzysztof Opasiak Samsung R&D Institute Poland Samsung Electronics --- Changes since v1: - drop incorrect typo fix ("iff" is not a typo but shorten version of "if and only if") Changes since v2: - replace BUG_ON() with WARN_ON() - s/arabic numeral/deciaml value - add more verbose commit messages - fix some typos - move out label in more suitable place Krzysztof Opasiak (4): 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 | 34 +++++++++++++++++--- drivers/usb/gadget/function/f_mass_storage.h | 1 + fs/configfs/dir.c | 29 +++++++++++++++++ include/linux/configfs.h | 9 ++++++ 5 files changed, 75 insertions(+), 5 deletions(-) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/