20 Jun, 2019
1 commit
-
the kobj refcount increased by kobject_get should be released before
error return, otherwise lead to a memory leak.Signed-off-by: Lin Yi
Signed-off-by: Greg Kroah-Hartman
03 May, 2019
1 commit
-
Commit 1fd7c3b438a2 ("kobject: Improve doc clarity kobject_init_and_add()")
tried to provide more clarity, but the reference to kobject_del() was
incorrect. Fix that up by removing that line, and hopefully be more explicit
as to exactly what needs to happen here once you register a kobject with the
kobject core.Acked-by: Tobin C. Harding
Fixes: 1fd7c3b438a2 ("kobject: Improve doc clarity kobject_init_and_add()")
Signed-off-by: Greg Kroah-Hartman
02 May, 2019
2 commits
-
kernel-doc comments have a prescribed format. This includes parenthesis
on the function name. To be _particularly_ correct we should also
capitalise the brief description and terminate it with a period.In preparation for adding/updating kernel-doc function comments clean up
the ones currently present.Signed-off-by: Tobin C. Harding
Signed-off-by: Greg Kroah-Hartman -
Currently the docstring for kobject_get_path() mentions 'kset'. The
kset is not used in the function callchain starting from this function.Remove docstring reference to kset from the function kobject_get_path().
Signed-off-by: Tobin C. Harding
Signed-off-by: Greg Kroah-Hartman
01 May, 2019
1 commit
-
The kobj pointer is being null-checked so potentially it could be null,
however, the ktype declaration before the null check is dereferencing kobj
hence we have a potential null pointer deference. Fix this by moving the
assignment of ktype after kobj has been null checked.Addresses-Coverity: ("Dereference before null check")
Fixes: aa30f47cf666 ("kobject: Add support for default attribute groups to kobj_type")
Signed-off-by: Colin Ian King
Signed-off-by: Greg Kroah-Hartman
29 Apr, 2019
2 commits
-
Function kobject_init_and_add() is currently misused in a number of
places in the kernel. On error return kobject_put() must be called but
is at times not.Make the function documentation more explicit about calling
kobject_put() in the error path.Signed-off-by: Tobin C. Harding
Signed-off-by: Greg Kroah-Hartman -
There is currently some confusion on how to wind back
kobject_init_and_add() during the error paths in code that uses this
function.Add documentation to kobject_add() and kobject_del() to help clarify the
usage.Signed-off-by: Tobin C. Harding
Signed-off-by: Greg Kroah-Hartman
26 Apr, 2019
1 commit
-
kobj_type currently uses a list of individual attributes to store
default attributes. Attribute groups are more flexible than a list of
attributes because groups provide support for attribute visibility. So,
add support for default attribute groups to kobj_type.In future patches, the existing uses of kobj_type’s attribute list will
be converted to attribute groups. When that is complete, kobj_type’s
attribute list, “default_attrs”, will be removed.Signed-off-by: Kimberly Brown
Signed-off-by: Greg Kroah-Hartman
22 Jan, 2019
1 commit
-
kset_get_ownership() is only used in lib/kobject.c, so make it 'static'.
Signed-off-by: Eric Biggers
Reviewed-by: Rafael J. Wysocki
Signed-off-by: Greg Kroah-Hartman
06 Dec, 2018
1 commit
-
The current kref and kobject documentation may be
insufficient to understand these common pitfalls regarding
object lifetime and object releasing.Add a bit more documentation and improve the warnings
seen by the user, pointing to the right piece of documentation.Also, it's important to understand that making fun of people
publicly is not at all helpful, doesn't provide any value,
and it's not a healthy way of encouraging developers to do better."Mocking mercilessly" will, if anything, make developers feel bad
and go away. This kind of behavior should not be encouraged or justified.Signed-off-by: Ezequiel Garcia
Signed-off-by: Enric Balletbo i Serra
Signed-off-by: Gustavo Padovan
Signed-off-by: Matthias Brugger
Acked-by: Daniel Vetter
Acked-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman
19 Aug, 2018
1 commit
-
Pull driver core updates from Greg KH:
"Here are all of the driver core and related patches for 4.19-rc1.Nothing huge here, just a number of small cleanups and the ability to
now stop the deferred probing after init happens.All of these have been in linux-next for a while with only a merge
issue reported"* tag 'driver-core-4.19-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (21 commits)
base: core: Remove WARN_ON from link dependencies check
drivers/base: stop new probing during shutdown
drivers: core: Remove glue dirs from sysfs earlier
driver core: remove unnecessary function extern declare
sysfs.h: fix non-kernel-doc comment
PM / Domains: Stop deferring probe at the end of initcall
iommu: Remove IOMMU_OF_DECLARE
iommu: Stop deferring probe at end of initcalls
pinctrl: Support stopping deferred probe after initcalls
dt-bindings: pinctrl: add a 'pinctrl-use-default' property
driver core: allow stopping deferred probe after init
driver core: add a debugfs entry to show deferred devices
sysfs: Fix internal_create_group() for named group updates
base: fix order of OF initialization
linux/device.h: fix kernel-doc notation warning
Documentation: update firmware loader fallback reference
kobject: Replace strncpy with memcpy
drivers: base: cacheinfo: use OF property_read_u32 instead of get_property,read_number
kernfs: Replace strncpy with memcpy
device: Add #define dev_fmt similar to #define pr_fmt
...
21 Jul, 2018
2 commits
-
This change implements get_ownership() for ksets created with
kset_create_and_add() call by fetching ownership data from parent kobject.
This is done mostly for benefit of "queues" attribute of net devices so
that corresponding directory belongs to container's root instead of global
root for network devices in a container.Signed-off-by: Dmitry Torokhov
Reviewed-by: Tyler Hicks
Signed-off-by: David S. Miller -
Normally kobjects and their sysfs representation belong to global root,
however it is not necessarily the case for objects in separate namespaces.
For example, objects in separate network namespace logically belong to the
container's root and not global root.This change lays groundwork for allowing network namespace objects
ownership to be transferred to container's root user by defining
get_ownership() callback in ktype structure and using it in sysfs code to
retrieve desired uid/gid when creating sysfs objects for given kobject.Co-Developed-by: Tyler Hicks
Signed-off-by: Dmitry Torokhov
Signed-off-by: Tyler Hicks
Signed-off-by: David S. Miller
07 Jul, 2018
1 commit
-
gcc 8.1.0 complains:
lib/kobject.c:128:3: warning:
'strncpy' output truncated before terminating nul copying as many
bytes from a string as its length [-Wstringop-truncation]
lib/kobject.c: In function 'kobject_get_path':
lib/kobject.c:125:13: note: length computed hereUsing strncpy() is indeed less than perfect since the length of data to
be copied has already been determined with strlen(). Replace strncpy()
with memcpy() to address the warning and optimize the code a little.Signed-off-by: Guenter Roeck
Signed-off-by: Greg Kroah-Hartman
23 Apr, 2018
1 commit
-
This WARNING proved to be noisy. The function still returns an error
and callers should handle it. That's how most of kernel code works.
Downgrade the WARNING to pr_err() and leave WARNINGs for kernel bugs.Signed-off-by: Dmitry Vyukov
Reported-by: syzbot+209c0f67f99fec8eb14b@syzkaller.appspotmail.com
Reported-by: syzbot+7fb6d9525a4528104e05@syzkaller.appspotmail.com
Reported-by: syzbot+2e63711063e2d8f9ea27@syzkaller.appspotmail.com
Reported-by: syzbot+de73361ee4971b6e6f75@syzkaller.appspotmail.com
Cc: stable
Signed-off-by: Greg Kroah-Hartman
15 Mar, 2018
1 commit
-
There is no need to split string literals. Moreover, it would be simpler
to grep for an actual code line, when debugging, by using almost any
part of the string literal in question.While here, replace printk(LEVEL) by pr_lvl() macros.
No functional change intended.
Signed-off-by: Andy Shevchenko
Signed-off-by: Greg Kroah-Hartman
02 Feb, 2018
1 commit
-
Pull driver core updates from Greg KH:
"Here is the set of "big" driver core patches for 4.16-rc1.The majority of the work here is in the firmware subsystem, with
reworks to try to attempt to make the code easier to handle in the
long run, but no functional change. There's also some tree-wide sysfs
attribute fixups with lots of acks from the various subsystem
maintainers, as well as a handful of other normal fixes and changes.And finally, some license cleanups for the driver core and sysfs code.
All have been in linux-next for a while with no reported issues"
* tag 'driver-core-4.16-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (48 commits)
device property: Define type of PROPERTY_ENRTY_*() macros
device property: Reuse property_entry_free_data()
device property: Move property_entry_free_data() upper
firmware: Fix up docs referring to FIRMWARE_IN_KERNEL
firmware: Drop FIRMWARE_IN_KERNEL Kconfig option
USB: serial: keyspan: Drop firmware Kconfig options
sysfs: remove DEBUG defines
sysfs: use SPDX identifiers
drivers: base: add coredump driver ops
sysfs: add attribute specification for /sysfs/devices/.../coredump
test_firmware: fix missing unlock on error in config_num_requests_store()
test_firmware: make local symbol test_fw_config static
sysfs: turn WARN() into pr_warn()
firmware: Fix a typo in fallback-mechanisms.rst
treewide: Use DEVICE_ATTR_WO
treewide: Use DEVICE_ATTR_RO
treewide: Use DEVICE_ATTR_RW
sysfs.h: Use octal permissions
component: add debugfs support
bus: simple-pm-bus: convert bool SIMPLE_PM_BUS to tristate
...
24 Jan, 2018
1 commit
-
Make it possible to call these two functions from a kernel module.
Note: despite their name, these two functions can be used meaningfully
independent of kobjects. A later patch will add calls to these
functions from the SRP driver because this patch series modifies the
SRP driver such that it can hold a reference to a namespace that can
last longer than the lifetime of the process through which the
namespace reference was obtained.Signed-off-by: Bart Van Assche
Acked-by: Greg Kroah-Hartman
Signed-off-by: Doug Ledford
08 Dec, 2017
2 commits
-
Now that the SPDX tag is in all kobject files, that identifies the
license in a specific and legally-defined manner. So the extra GPL text
wording can be removed as it is no longer needed at all.This is done on a quest to remove the 700+ different ways that files in
the kernel describe the GPL license text. And there's unneeded stuff
like the address (sometimes incorrect) for the FSF which is never
needed.No copyright headers or other non-license-description text was removed.
Signed-off-by: Greg Kroah-Hartman
-
It's good to have SPDX identifiers in all files to make it easier to
audit the kernel tree for correct licenses.Update the kobject files files with the correct SPDX license identifier
based on the license text in the file itself. The SPDX identifier is a
legally binding shorthand, which can be used instead of the full boiler
plate text.This work is based on a script and data from Thomas Gleixner, Philippe
Ombredanne, and Kate Stewart.Cc: Thomas Gleixner
Cc: Kate Stewart
Cc: Philippe Ombredanne
Signed-off-by: Greg Kroah-Hartman
23 Mar, 2017
1 commit
-
Make the function available for outside use and fortify it against NULL
kobject.CC: Greg Kroah-Hartman
Reviewed-by: Bart Van Assche
Acked-by: Tejun Heo
Signed-off-by: Jan Kara
Signed-off-by: Jens Axboe
10 Feb, 2016
1 commit
-
Signed-off-by: Gabriel Somlo
Signed-off-by: Greg Kroah-Hartman
07 Nov, 2015
1 commit
-
Sometimes kobject_set_name_vargs is called with a format string conaining
no %, or a format string of precisely "%s", where the single vararg
happens to point to .rodata. kvasprintf_const detects these cases for us
and returns a copy of that pointer instead of duplicating the string, thus
saving some run-time memory. Otherwise, it falls back to kvasprintf. We
just need to always deallocate ->name using kfree_const.Unfortunately, the dance we need to do to perform the '/' -> '!'
sanitization makes the resulting code rather ugly.I instrumented kstrdup_const to provide some statistics on the memory
saved, and for me this gave an additional ~14KB after boot (306KB was
already saved; this patch bumped that to 320KB). I have
KMALLOC_SHIFT_LOW==3, and since 80% of the kvasprintf_const hits were
satisfied by an 8-byte allocation, the 14K would roughly be quadrupled
when KMALLOC_SHIFT_LOW==5. Whether these numbers are sufficient to
justify the ugliness I'll leave to others to decide.Signed-off-by: Rasmus Villemoes
Cc: Greg KH
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
04 Oct, 2015
1 commit
-
Move EXPORT_SYMBOL() macros in kobject.c from the end of the file
next to the function definitions to which they belong.Signed-off-by: Gabriel Somlo
Signed-off-by: Greg Kroah-Hartman
18 Jul, 2015
1 commit
-
Using __printf attributes helps to detect several format string issues
at compile time (even though -Wformat-security is currently disabled in
Makefile). For example it can detect when formatting a pointer as a
number, like the issue fixed in commit a3fa71c40f18 ("wl18xx: show
rx_frames_per_rates as an array as it really is"), or when the arguments
do not match the format string, c.f. for example commit 5ce1aca81435
("reiserfs: fix __RASSERT format string").To prevent similar bugs in the future, add a __printf attribute to every
function prototype which needs one in include/linux/ and lib/. These
functions were mostly found by using gcc's -Wsuggest-attribute=format
flag.Signed-off-by: Nicolas Iooss
Cc: Greg Kroah-Hartman
Cc: Felipe Balbi
Cc: Joel Becker
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
01 Jul, 2015
1 commit
-
Pull btrfs updates from Chris Mason:
"Outside of our usual batch of fixes, this integrates the subvolume
quota updates that Qu Wenruo from Fujitsu has been working on for a
few releases now. He gets an extra gold star for making btrfs smaller
this time, and fixing a number of quota corners in the process.Dave Sterba tested and integrated Anand Jain's sysfs improvements.
Outside of exporting a symbol (ack'd by Greg) these are all internal
to btrfs and it's mostly cleanups and fixes. Anand also attached some
of our sysfs objects to our internal device management structs instead
of an object off the super block. It will make device management
easier overall and it's a better fit for how the sysfs files are used.
None of the existing sysfs files are moved around.Thanks for all the fixes everyone"
* 'for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (87 commits)
btrfs: delayed-ref: double free in btrfs_add_delayed_tree_ref()
Btrfs: Check if kobject is initialized before put
lib: export symbol kobject_move()
Btrfs: sysfs: add support to show replacing target in the sysfs
Btrfs: free the stale device
Btrfs: use received_uuid of parent during send
Btrfs: fix use-after-free in btrfs_replay_log
btrfs: wait for delayed iputs on no space
btrfs: qgroup: Make snapshot accounting work with new extent-oriented qgroup.
btrfs: qgroup: Add the ability to skip given qgroup for old/new_roots.
btrfs: ulist: Add ulist_del() function.
btrfs: qgroup: Cleanup the old ref_node-oriented mechanism.
btrfs: qgroup: Switch self test to extent-oriented qgroup mechanism.
btrfs: qgroup: Switch to new extent-oriented qgroup mechanism.
btrfs: qgroup: Switch rescan to new mechanism.
btrfs: qgroup: Add new qgroup calculation function btrfs_qgroup_account_extents().
btrfs: backref: Add special time_seq == (u64)-1 case for btrfs_find_all_roots().
btrfs: qgroup: Add new function to record old_roots.
btrfs: qgroup: Record possible quota-related extent for qgroup.
btrfs: qgroup: Add function qgroup_update_counters().
...
26 Jun, 2015
1 commit
-
There's probably not many slashes in the name, but starting over when
we see one feels wrong.Signed-off-by: Rasmus Villemoes
Cc: Greg Kroah-Hartman
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
19 Jun, 2015
1 commit
-
drivers/cpufreq/cpufreq.c is already using this function. And now btrfs
needs it as well. Export symbol kobject_move().Signed-off-by: Anand Jain
Acked-by: Greg Kroah-Hartman
Signed-off-by: David Sterba
25 Mar, 2015
1 commit
-
call kobject_get() to kojbect that is not initalized or released will only
leave following like call trace to us:-----------[ cut here ]------------
[ 54.545816] WARNING: CPU: 0 PID: 213 at include/linux/kref.h:47
kobject_get+0x41/0x50()
[ 54.642595] Modules linked in: i2c_i801(+) mfd_core shpchp(+)
acpi_cpufreq(+) edac_core ioatdma(+) xfs libcrc32c ast syscopyarea ixgbe
sysfillrect sysimgblt sr_mod sd_mod drm_kms_helper igb mdio cdrom e1000e ahci
dca ttm libahci uas drm i2c_algo_bit ptp megaraid_sas libata usb_storage
i2c_core pps_core dm_mirror dm_region_hash dm_log dm_mod
[ 55.007264] CPU: 0 PID: 213 Comm: kworker/0:2 Not tainted
3.18.5
[ 55.099970] Hardware name: Oracle Corporation SUN FIRE X4170 M2 SERVER
/ASSY,MOTHERBOARD,X4170, BIOS 08120104 05/08/2012
[ 55.239736] Workqueue: kacpi_notify acpi_os_execute_deferred
[ 55.308598] 0000000000000000 00000000bd730b61 ffff88046742baf8
ffffffff816b7edb
[ 55.398305] 0000000000000000 0000000000000000 ffff88046742bb38
ffffffff81078ae1
[ 55.488040] ffff88046742bbd8 ffff8806706b3000 0000000000000292
0000000000000000
[ 55.577776] Call Trace:
[ 55.608228] [] dump_stack+0x46/0x58
[ 55.670895] [] warn_slowpath_common+0x81/0xa0
[ 55.743952] [] warn_slowpath_null+0x1a/0x20
[ 55.814929] [] kobject_get+0x41/0x50
[ 55.878654] [] cpufreq_cpu_get+0x75/0xc0
[ 55.946528] [] cpufreq_update_policy+0x2e/0x1f0The above issue was casued by a race condition, if there is a WARN in
kobject_get() of the kobject is not initialized, that would save us much
time to debug it.Signed-off-by: Ethan Zhao
Signed-off-by: Greg Kroah-Hartman
08 Nov, 2014
1 commit
-
We will hit NULL pointer dereference if we call
platform_device_register_simple or platform_device_add at very early
stage. I have observed following crash when called platform_device_add
from "init_irq" hook of machine_desc. This patch fixes this issue and
let system handle this case gracefully instead of kernel panic.[0.000000] Unable to handle kernel NULL pointer dereference at
virtual address 0000000c
[0.000000] pgd = c0004000
[0.000000] [0000000c] *pgd=00000000
[0.000000] Internal error: Oops: 5 [#1] PREEMPT ARM
[0.000000] Modules linked in:
[0.000000] CPU: 0 PID: 0 Comm: swapper Tainted: G W 3.17.0-rc6-00198-ga1603f1-dirty #319
[0.000000] task: c05b23f0 ti: c05a8000 task.ti: c05a8000
[0.000000] PC is at kobject_namespace+0x18/0x58
[0.000000] LR is at kobject_add_internal+0x90/0x2ec
[snip]
[0.000000] [] (kobject_namespace) from [] (kobject_add_internal+0x90/0x2ec)
[0.000000] [] (kobject_add_internal) from [] (kobject_add+0x4c/0x98)
[0.000000] [] (kobject_add) from [] (device_add+0xe8/0x51c)
[0.000000] [] (device_add) from [] (platform_device_add+0xb4/0x214)
[0.000000] [] (platform_device_add) from [] (platform_device_register_full+0xb8/0xdc)
[0.000000] [] (platform_device_register_full) from [] (exynos_init_irq+0x90/0x9c)
[0.000000] [] (exynos_init_irq) from [] (init_IRQ+0x2c/0x78)
[0.000000] [] (init_IRQ) from [] (start_kernel+0x22c/0x378)
[0.000000] [] (start_kernel) from [] (0x40008070)
[0.000000] Code: e590000c e3500000 0a00000e e5903014 (e593300c)Signed-off-by: Pankaj Dubey
Signed-off-by: Greg Kroah-Hartman
08 Feb, 2014
1 commit
-
Currently, kobject is invoking kernfs_enable_ns() directly. This is
fine now as sysfs and kernfs are enabled and disabled together. If
sysfs is disabled, kernfs_enable_ns() is switched to dummy
implementation too and everything is fine; however, kernfs will soon
have its own config option CONFIG_KERNFS and !SYSFS && KERNFS will be
possible, which can make kobject call into non-dummy
kernfs_enable_ns() with NULL kernfs_node pointers leading to an oops.Introduce sysfs_enable_ns() which is a wrapper around
kernfs_enable_ns() so that it can be made a noop depending only on
CONFIG_SYSFS regardless of the planned CONFIG_KERNFS.Signed-off-by: Tejun Heo
Reported-by: Fengguang Wu
Signed-off-by: Greg Kroah-Hartman
31 Jan, 2014
1 commit
-
Pull btrfs updates from Chris Mason:
"This is a pretty big pull, and most of these changes have been
floating in btrfs-next for a long time. Filipe's properties work is a
cool building block for inheriting attributes like compression down on
a per inode basis.Jeff Mahoney kicked in code to export filesystem info into sysfs.
Otherwise, lots of performance improvements, cleanups and bug fixes.
Looks like there are still a few other small pending incrementals, but
I wanted to get the bulk of this in first"* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs: (149 commits)
Btrfs: fix spin_unlock in check_ref_cleanup
Btrfs: setup inode location during btrfs_init_inode_locked
Btrfs: don't use ram_bytes for uncompressed inline items
Btrfs: fix btrfs_search_slot_for_read backwards iteration
Btrfs: do not export ulist functions
Btrfs: rework ulist with list+rb_tree
Btrfs: fix memory leaks on walking backrefs failure
Btrfs: fix send file hole detection leading to data corruption
Btrfs: add a reschedule point in btrfs_find_all_roots()
Btrfs: make send's file extent item search more efficient
Btrfs: fix to catch all errors when resolving indirect ref
Btrfs: fix protection between walking backrefs and root deletion
btrfs: fix warning while merging two adjacent extents
Btrfs: fix infinite path build loops in incremental send
btrfs: undo sysfs when open_ctree() fails
Btrfs: fix snprintf usage by send's gen_unique_name
btrfs: fix defrag 32-bit integer overflow
btrfs: sysfs: list the NO_HOLES feature
btrfs: sysfs: don't show reserved incompat feature
btrfs: call permission checks earlier in ioctls and return EPERM
...
29 Jan, 2014
1 commit
-
struct kobj_attribute implements the baseline attribute functionality
that can be used all over the place. We should export the ops associated
with it.Signed-off-by: Jeff Mahoney
Signed-off-by: Greg Kroah-Hartman
Signed-off-by: Josef Bacik
Signed-off-by: Chris Mason
09 Jan, 2014
1 commit
-
Signed-off-by: Bart Van Assche
Signed-off-by: Greg Kroah-Hartman
05 Jan, 2014
1 commit
-
This reverts commit eee031649707db3c9920d9498f8d03819b74fc23.
Jeff writes:
I have no objections to reverting it. There were concerns from
Al Viro that it'd be tough to get right by callers and I had
assumed it got dropped after that. I had planned on using it in
my btrfs sysfs exports patchset but came up with a better way.Cc: Jeff Mahoney
Cc: Al Viro
Signed-off-by: Greg Kroah-Hartman
12 Dec, 2013
1 commit
-
kernfs has just been separated out from sysfs and we're already in
full conflict mode. Nothing can make the situation any worse. Let's
take the chance to name things properly.This patch performs the following renames.
* s/sysfs_elem_dir/kernfs_elem_dir/
* s/sysfs_elem_symlink/kernfs_elem_symlink/
* s/sysfs_elem_attr/kernfs_elem_file/
* s/sysfs_dirent/kernfs_node/
* s/sd/kn/ in kernfs proper
* s/parent_sd/parent/
* s/target_sd/target/
* s/dir_sd/parent/
* s/to_sysfs_dirent()/rb_to_kn()/
* misc renames of local vars when they conflict with the aboveBecause md, mic and gpio dig into sysfs details, this patch ends up
modifying them. All are sysfs_dirent renames and trivial. While we
can avoid these by introducing a dummy wrapping struct sysfs_dirent
around kernfs_node, given the limited usage outside kernfs and sysfs
proper, I don't think such workaround is called for.This patch is strictly rename only and doesn't introduce any
functional difference.- mic / gpio renames were missing. Spotted by kbuild test robot.
Signed-off-by: Tejun Heo
Cc: Neil Brown
Cc: Linus Walleij
Cc: Ashutosh Dixit
Cc: kbuild test robot
Signed-off-by: Greg Kroah-Hartman
09 Dec, 2013
1 commit
-
If the call to kvasprintf fails then the old name of the object will be leaked,
this patch fixes the bug by restoring the old name before returning ENOMEM.Signed-off-by: Maurizio Lombardi
Signed-off-by: Greg Kroah-Hartman
08 Dec, 2013
2 commits
-
There's no "unlink from sysfs" interface for ksets, so I think callers of
kset_unregister() expect the kset to be removed from sysfs immediately,
without waiting for the last reference to be released.This patch makes the sysfs removal happen immediately, so the caller may
create a new kset with the same name as soon as kset_unregister() returns.
Without this, every caller has to call "kobject_del(&kset->kobj)" first
unless it knows it will never create a new kset with the same name.This sometimes shows up on module unload and reload, where the reload fails
because it tries to create a kobject with the same name as one from the
original load that still exists. CONFIG_DEBUG_KOBJECT_RELEASE=y makes this
problem easier to hit.Signed-off-by: Bjorn Helgaas
Signed-off-by: Greg Kroah-Hartman -
When CONFIG_DEBUG_KOBJECT_RELEASE=y, delay kobject release functions for a
random time between 1 and 8 seconds, which effectively changes the order in
which they're called.Signed-off-by: Bjorn Helgaas
Signed-off-by: Greg Kroah-Hartman
30 Nov, 2013
1 commit
-
Introduce kernfs interface to manipulate a directory which takes and
returns sysfs_dirents.create_dir() is renamed to kernfs_create_dir_ns() and its argumantes
and return value are updated. create_dir() usages are replaced with
kernfs_create_dir_ns() and sysfs_create_subdir() usages are replaced
with kernfs_create_dir(). Dup warnings are handled explicitly by
sysfs users of the kernfs interface.sysfs_enable_ns() is renamed to kernfs_enable_ns().
This patch doesn't introduce any behavior changes.
v2: Dummy implementation for !CONFIG_SYSFS updated to return -ENOSYS.
v3: kernfs_enable_ns() added.
v4: Refreshed on top of "sysfs: drop kobj_ns_type handling, take #2"
so that this patch removes sysfs_enable_ns().Signed-off-by: Tejun Heo
Signed-off-by: Greg Kroah-Hartman