27 Sep, 2016
2 commits
-
This patch converts printk(KERN_* style messages to use the pr_* versions.
One side effect is that anything that was KERN_DEBUG is now automatically
a dynamic debug message.Signed-off-by: Jeff Mahoney
Signed-off-by: David Sterba -
CodingStyle chapter 2:
"[...] never break user-visible strings such as printk messages,
because that breaks the ability to grep for them."This patch unsplits user-visible strings.
Signed-off-by: Jeff Mahoney
Signed-off-by: David Sterba
26 Sep, 2016
2 commits
-
Reviewed-by: Eric Sandeen
Signed-off-by: David Sterba -
btrfs provides a helpful demonstration of how to export
a global variable via debugfs; however, it is unique among
other debugfs files in that it is world-writable, which causes
some concern to people who are not familiar with its purpose.Fix it so that it is only user-writable.
Signed-off-by: Eric Sandeen
Reviewed-by: David Sterba
Signed-off-by: David Sterba
26 Jul, 2016
1 commit
-
Signed-off-by: Wang Xiaoguang
Signed-off-by: David Sterba
06 May, 2016
3 commits
-
If the label setting ioctl races with sysfs label handler, we could get
mixed result in the output, part old part new. We should either get the
old or new label. The chances to hit this race are low.Signed-off-by: David Sterba
-
Add a sanity check for the fs_info as we will dereference it, similar to
what the 'store features' handler does.Signed-off-by: David Sterba
-
We don't want to trigger the change on a read-only filesystem, similar
to what the label handler does.Signed-off-by: David Sterba
27 Jan, 2016
1 commit
-
If the mount phase is not finished, we can't update the sysfs files.
Reported-by: Chris Mason
Signed-off-by: David Sterba
Signed-off-by: Chris Mason
22 Jan, 2016
2 commits
-
The files under /sys/fs/UUID/features get out of sync with the actual
incompat bits set for the filesystem if they change after mount. We're
going to sync them and need a helper to do that.Signed-off-by: David Sterba
-
The incompat bit representing the newly added free space tree feature is
missing. Right now it will be listed only among features supported by
the module, not per-fs.Signed-off-by: David Sterba
29 Sep, 2015
5 commits
-
Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
Signed-off-by: Anand Jain
Signed-off-by: David Sterba
22 Jun, 2015
1 commit
-
Signed-off-by: Anand Jain
Tested-by: David Sterba
Signed-off-by: David Sterba
27 May, 2015
18 commits
-
To support seed sysfs layout and represent seed fsid under
the sprout we need the facility to create fsid under the
specified parent.Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
since btrfs_kobj_rm_device() does nothing with fs_info
Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
btrfs_kobj_add_device() does not need fs_info any more.
Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
Just a helper function to clean up the sysfs fsid kobjects.
Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
adds fs_info pointer with struct btrfs_fs_devices.
Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
This patch will provide a framework and help to create attributes
from the structure btrfs_fs_devices which are available even before
fs_info is created. So by moving the parent kobject super_kobj from
fs_info to btrfs_fs_devices, it will help to create attributes
from the btrfs_fs_devices as well.Patches on top of this patch now will be able to create the
sys/fs/btrfs/fsid kobject and attributes from btrfs_fs_devices
when devices are scanned and registered to the kernel.Just to note, this does not change any of the existing btrfs sysfs
external kobject names and its attributes and not even the life
cycle of them. Changes are internal only. And to ensure the same,
this path has been tested with various device operations and,
checking and comparing the sysfs kobjects and attributes with
sysfs kobject and attributes with out this patch, and they remain
same.Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
Separate device kobject and its attribute creation so that device
kobject can be created from the device discovery thread.Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
As of now btrfs_attrs are provided using the default_attrs through
the kset. Separate them and create the default_attrs using the
sysfs_create_files instead. By doing this we will have the
flexibility that device discovery thread could create fsid
kobject.Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
We need it in a seperate function so that it can be called from the
device discovery thread as well.Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
As of now the order in which the kobjects are created
at btrfs_sysfs_add_one() is..
fsid
features
unknown features (dynamic features)
devices.Since we would move fsid and device kobject to fs_devices
from fs_info structure, this patch will reorder in which
the kobjects are created as below.
fsid
devices
features
unknown features (dynamic features)And hence the btrfs_sysfs_remove_one() will follow the same
in reverse order. and the device kobject destroy now can
be moved into the function __btrfs_sysfs_remove_one()Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
Since the failure code in the btrfs_sysfs_add_one() can
call btrfs_sysfs_remove_one() even before device_dir_kobj
has been created we need to check if its null.Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
The sysfs clean up self test like in the below code fails, since
fs_info->device_dir_kobject still points to its stale kobject.
Reseting this pointer will help to fix this.open_ctree()
{ret = btrfs_sysfs_add_one(fs_info);
::
+ btrfs_sysfs_remove_one(fs_info);
+ ret = btrfs_sysfs_add_one(fs_info);
+ if (ret) {
+ pr_err("BTRFS: failed to init sysfs interface: %d\n", ret);
+ goto fail_block_groups;
+ }Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
Theoritically need to remove the device links attributes, but since its entire device
kobject was removed, so there wasn't any issue of about it. Just do it nicely.Signed-off-by: Anand Jain
Signed-off-by: David Sterba -
The following test case fails indicating that, thread tried to init an initialized object.
kernel: [232104.016513] kobject (ffff880006c1c980): tried to init an initialized object, something is seriously wrong.
btrfs_sysfs_remove_one() self test code:
open_tree()
{
::
ret = btrfs_sysfs_add_one(fs_info);
if (ret) {
pr_err("BTRFS: failed to init sysfs interface: %d\n", ret);
goto fail_block_groups;
}
+ btrfs_sysfs_remove_one(fs_info);
+ ret = btrfs_sysfs_add_one(fs_info);
+ if (ret) {
+ pr_err("BTRFS: failed to init sysfs interface: %d\n", ret);
+ goto fail_block_groups;
+ }cleaning up the unregistered kobject fixes this.
Signed-off-by: Anand Jain
Signed-off-by: David Sterba
17 Feb, 2015
1 commit
-
There are some op tables that can be easily made const, similarly the
sysfs feature and raid tables. This is motivated by PaX CONSTIFY plugin.Signed-off-by: David Sterba
03 Feb, 2015
1 commit
-
If we failed during initialization of sysfs, we weren't unregistering the
top level btrfs sysfs entry nor the debugfs stuff.
Not unregistering the top level sysfs entry makes future attempts to reload
the btrfs module impossible and the following is reported in dmesg:[ 2246.451296] WARNING: CPU: 3 PID: 10999 at fs/sysfs/dir.c:486 sysfs_warn_dup+0x91/0xb0()
[ 2246.451298] sysfs: cannot create duplicate filename '/fs/btrfs'
[ 2246.451298] Modules linked in: btrfs(+) raid6_pq xor bnep rfcomm bluetooth binfmt_misc nfsd auth_rpcgss oid_registry nfs_acl nfs lockd fscache sunrpc parport_pc parport psmouse serio_raw pcspkr evbug i2c_piix4 e1000 floppy [last unloaded: btrfs]
[ 2246.451310] CPU: 3 PID: 10999 Comm: modprobe Tainted: G W 3.13.0-fdm-btrfs-next-24+ #7
[ 2246.451311] Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
[ 2246.451312] 0000000000000009 ffff8800d353fa08 ffffffff816f1da6 0000000000000410
[ 2246.451314] ffff8800d353fa58 ffff8800d353fa48 ffffffff8104a32c ffff88020821a290
[ 2246.451316] ffff88020821a290 ffff88020821a290 ffff8802148f0000 ffff8800d353fb80
[ 2246.451318] Call Trace:
[ 2246.451322] [] dump_stack+0x4e/0x68
[ 2246.451324] [] warn_slowpath_common+0x8c/0xc0
[ 2246.451325] [] warn_slowpath_fmt+0x46/0x50
[ 2246.451328] [] ? strlcat+0x65/0x90
(....)This fixes the following change:
btrfs: add simple debugfs interface
commit 1bae30982bc86ab66d61ccb6e22792593b45d44dSigned-off-by: Filipe Manana
Signed-off-by: Chris Mason
12 Nov, 2014
2 commits
-
Signed-off-by: David Sterba
-
Signed-off-by: David Sterba
18 Sep, 2014
1 commit
-
Not sure how this escaped many eyes so far
Signed-off-by: Anand Jain
Signed-off-by: Chris Mason