Pascal Eberhard
74e9c700bc
ubifs: fix host xattr_len when changing xattr
...
When an extended attribute is changed, xattr_len of host inode is
recalculated. ui->data_len is updated before computation and result
is wrong. This patch adds a temporary variable to fix computation.
To reproduce the issue:
~# > a.txt
~# attr -s an-attr -V a-value a.txt
~# attr -s an-attr -V a-bit-bigger-value a.txt
Now host inode xattr_len is wrong. Forcing dbg_check_filesystem()
generates the following error:
[ 130.620140] UBIFS (ubi0:2): background thread "ubifs_bgt0_2" started, PID 565
[ 131.470790] UBIFS error (ubi0:2 pid 564): check_inodes: inode 646 has xattr size 240, but calculated size is 256
[ 131.481697] UBIFS (ubi0:2): dump of the inode 646 sitting in LEB 29:114688
[ 131.488953] magic 0x6101831
[ 131.492876] crc 0x9fce9091
[ 131.496836] node_type 0 (inode node)
[ 131.501193] group_type 1 (in node group)
[ 131.505788] sqnum 9278
[ 131.509191] len 160
[ 131.512549] key (646, inode)
[ 131.516688] creat_sqnum 9270
[ 131.520133] size 0
[ 131.523264] nlink 1
[ 131.526398] atime 1053025857.0
[ 131.530574] mtime 1053025857.0
[ 131.534714] ctime 1053025906.0
[ 131.538849] uid 0
[ 131.542009] gid 0
[ 131.545140] mode 33188
[ 131.548636] flags 0x1
[ 131.551977] xattr_cnt 1
[ 131.555108] xattr_size 240
[ 131.558420] xattr_names 12
[ 131.561670] compr_type 0x1
[ 131.564983] data len 0
[ 131.568125] UBIFS error (ubi0:2 pid 564): dbg_check_filesystem: file-system check failed with error -22
[ 131.578074] CPU: 0 PID: 564 Comm: mount Not tainted 4.4.12-g3639bea54a #24
[ 131.585352] Hardware name: Generic AM33XX (Flattened Device Tree)
[ 131.591918] [<c00151c0>] (unwind_backtrace) from [<c0012acc>] (show_stack+0x10/0x14)
[ 131.600177] [<c0012acc>] (show_stack) from [<c01c950c>] (dbg_check_filesystem+0x464/0x4d0)
[ 131.608934] [<c01c950c>] (dbg_check_filesystem) from [<c019f36c>] (ubifs_mount+0x14f8/0x2130)
[ 131.617991] [<c019f36c>] (ubifs_mount) from [<c00d7088>] (mount_fs+0x14/0x98)
[ 131.625572] [<c00d7088>] (mount_fs) from [<c00ed674>] (vfs_kern_mount+0x4c/0xd4)
[ 131.633435] [<c00ed674>] (vfs_kern_mount) from [<c00efb5c>] (do_mount+0x988/0xb50)
[ 131.641471] [<c00efb5c>] (do_mount) from [<c00f004c>] (SyS_mount+0x74/0xa0)
[ 131.648837] [<c00f004c>] (SyS_mount) from [<c000fe20>] (ret_fast_syscall+0x0/0x3c)
[ 131.665315] UBIFS (ubi0:2): background thread "ubifs_bgt0_2" stops
Signed-off-by: Pascal Eberhard <pascal.eberhard@gmail.com>
Signed-off-by: Richard Weinberger <richard@nod.at>
2016-10-02 22:55:02 +02:00
..
2016-08-07 10:01:14 -04:00
2016-08-07 10:01:14 -04:00
2016-07-31 16:37:25 -04:00
2016-08-06 00:08:40 -04:00
2016-08-06 09:49:02 -04:00
2016-05-23 17:04:14 -07:00
2016-05-09 11:41:14 -04:00
2016-09-09 12:52:31 -07:00
2016-08-03 13:33:26 -04:00
2016-09-05 14:30:35 +02:00
2016-09-09 23:58:07 -05:00
2016-05-29 19:08:00 -04:00
2016-07-10 21:02:18 +09:00
2016-05-09 11:41:14 -04:00
2016-09-10 01:18:57 -04:00
2016-06-30 23:34:49 -04:00
2016-09-03 11:02:50 -07:00
2016-08-26 13:22:14 -05:00
2016-07-08 10:35:28 -05:00
2016-07-31 16:37:25 -04:00
2016-05-20 17:58:30 -07:00
2016-06-07 13:41:38 -06:00
2016-05-02 19:49:29 -04:00
2016-08-06 09:49:02 -04:00
2016-09-10 01:18:57 -04:00
2016-09-10 01:18:57 -04:00
2016-08-07 10:01:14 -04:00
2016-06-13 10:20:39 +02:00
2016-06-30 23:34:49 -04:00
2016-08-24 18:17:04 +02:00
2016-08-07 10:03:31 -04:00
2016-08-07 10:01:14 -04:00
2016-08-07 10:01:14 -04:00
2016-08-04 00:18:10 +02:00
2016-07-31 16:37:25 -04:00
2016-04-04 10:41:08 -07:00
2016-07-31 16:37:25 -04:00
2016-07-26 18:35:55 -07:00
2016-06-10 20:21:46 -07:00
2016-07-31 16:37:25 -04:00
2016-08-31 14:48:52 +02:00
2016-07-28 12:59:05 -07:00
2016-08-06 09:49:02 -04:00
2016-05-02 19:49:32 -04:00
2016-07-31 16:37:25 -04:00
2016-09-11 14:56:44 -04:00
2016-08-12 16:10:25 -04:00
2016-08-02 19:35:21 -04:00
2016-05-19 19:12:14 -07:00
2016-07-28 12:59:05 -07:00
2016-08-06 09:49:02 -04:00
2016-05-09 11:41:14 -04:00
2016-05-09 11:41:14 -04:00
2016-08-02 15:39:13 -04:00
2016-09-05 13:55:20 +02:00
2016-09-10 09:58:52 -07:00
2016-08-05 11:21:46 -07:00
2016-05-09 11:41:14 -04:00
2016-05-09 11:41:14 -04:00
2016-07-29 15:54:19 -07:00
2016-05-20 17:58:30 -07:00
2016-08-02 19:35:22 -04:00
2016-05-09 11:41:15 -04:00
2016-06-07 13:41:38 -06:00
2016-08-31 15:14:44 +02:00
2016-06-10 20:21:46 -07:00
2016-05-29 16:22:07 -04:00
2016-10-02 22:55:02 +02:00
2016-07-26 15:37:51 -07:00
2016-07-28 12:59:05 -07:00
2016-08-30 13:51:39 +10:00
2016-09-15 15:49:28 -07:00
2016-07-05 15:06:46 -05:00
2016-05-27 20:09:16 -04:00
2016-05-28 16:34:59 -07:00
2016-07-25 16:51:49 +10:00
2016-08-31 09:13:56 -07:00
2016-08-02 19:35:15 -04:00
2016-07-28 13:29:12 +10:00
2016-08-07 10:13:14 -04:00
2016-08-25 08:38:26 -06:00
2016-07-27 09:53:35 -07:00
2016-07-14 16:21:53 +09:00
2016-06-28 10:00:13 -03:00
2016-05-24 12:55:26 -07:00
2016-06-07 22:07:09 -04:00
2016-07-28 17:38:16 -07:00
2016-08-07 10:01:14 -04:00
2016-06-07 13:41:38 -06:00
2016-03-22 15:36:02 -07:00
2016-05-19 19:12:14 -07:00
2016-08-04 18:04:44 -04:00
2016-03-22 15:36:02 -07:00
2016-05-02 19:49:28 -04:00
2016-08-09 19:58:06 -06:00
2016-08-07 10:01:14 -04:00
2016-08-07 10:13:14 -04:00
2016-09-15 13:29:52 -07:00
2016-08-29 11:33:58 +10:00
2016-08-04 19:59:06 -04:00
2016-07-28 13:29:13 +10:00
2016-06-20 17:11:29 -04:00
2016-07-01 10:24:18 -04:00
2016-06-21 09:23:11 +10:00
2016-08-07 14:41:02 -06:00
2016-08-07 10:03:31 -04:00
2016-07-29 15:54:19 -07:00
2016-08-07 10:13:14 -04:00
2016-08-09 10:14:10 -07:00
2016-05-05 09:54:45 -05:00
2016-07-29 15:54:19 -07:00
2016-03-16 13:09:08 -04:00
2016-07-15 10:30:26 +02:00
2016-05-26 00:13:25 -04:00
2016-05-19 19:12:14 -07:00
2016-08-26 17:39:35 -07:00
2016-05-11 00:00:29 -04:00
2016-07-29 15:54:19 -07:00
2016-04-04 10:41:08 -07:00
2016-06-09 23:42:38 +02:00
2016-07-26 16:19:19 -07:00
2016-08-07 10:03:31 -04:00
2016-07-05 15:06:46 -05:00