alistair23-linux/fs/ext4
Tahsin Erdogan bd3b963b27 ext4: attach jinode after creation of xattr inode
In data=ordered mode jinode needs to be attached to the xattr inode when
writing data to it. Attachment normally occurs during file open for regular
files. Since we are not using file interface to write to the xattr inode,
the jinode attach needs to be done manually.

Otherwise the following crash occurs in data=ordered mode.

 BUG: unable to handle kernel NULL pointer dereference at           (null)
 IP: jbd2_journal_file_inode+0x37/0x110
 PGD 13b3c0067
 P4D 13b3c0067
 PUD 137660067
 PMD 0

 Oops: 0000 [#1] SMP
 CPU: 3 PID: 1877 Comm: python Not tainted 4.12.0-rc1+ #749
 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
 task: ffff88010e368980 task.stack: ffffc90000374000
 RIP: 0010:jbd2_journal_file_inode+0x37/0x110
 RSP: 0018:ffffc90000377980 EFLAGS: 00010246
 RAX: 0000000000000000 RBX: ffff880123b06230 RCX: 0000000000280000
 RDX: 0000000000000006 RSI: 0000000000000000 RDI: ffff88012c8585d0
 RBP: ffffc900003779b0 R08: 0000000000000202 R09: 0000000000000001
 R10: 0000000000000000 R11: 0000000000000400 R12: ffff8801111f81c0
 R13: ffff88013b2b6800 R14: ffffc90000377ab0 R15: 0000000000000001
 FS:  00007f0c99b77740(0000) GS:ffff88013fd80000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 0000000000000000 CR3: 0000000136d91000 CR4: 00000000000006e0
 Call Trace:
  jbd2_journal_inode_add_write+0xe/0x10
  ext4_map_blocks+0x59e/0x620
  ext4_xattr_set_entry+0x501/0x7d0
  ext4_xattr_block_set+0x1b2/0x9b0
  ext4_xattr_set_handle+0x322/0x4f0
  ext4_xattr_set+0x144/0x1a0
  ext4_xattr_user_set+0x34/0x40
  __vfs_setxattr+0x66/0x80
  __vfs_setxattr_noperm+0x69/0x1c0
  vfs_setxattr+0xa2/0xb0
  setxattr+0x12e/0x150
  path_setxattr+0x87/0xb0
  SyS_setxattr+0xf/0x20
  entry_SYSCALL_64_fastpath+0x18/0xad

Signed-off-by: Tahsin Erdogan <tahsin@google.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2017-06-21 21:24:31 -04:00
..
acl.c ext4: fix quota charging for shared xattr blocks 2017-05-24 18:24:07 -04:00
acl.h ext2/3/4: use generic posix ACL infrastructure 2014-01-25 23:58:19 -05:00
balloc.c The major change this cycle is deleting ext4's copy of the file system 2016-07-26 18:35:55 -07:00
bitmap.c ext4: remove unused header files 2015-04-02 23:47:42 -04:00
block_validity.c ext4: add missing KERN_CONT to a few more debugging uses 2016-10-15 09:57:31 -04:00
dir.c ext4: remove unused variable 2016-09-30 02:14:56 -04:00
ext4.h ext4: do not set posix acls on xattr inodes 2017-06-21 21:21:39 -04:00
ext4_extents.h ext4: fix misspellings in comments. 2016-03-09 23:49:05 -05:00
ext4_jbd2.c ext4: add shutdown bit and check for it 2017-02-05 01:28:48 -05:00
ext4_jbd2.h ext4: add largedir feature 2017-06-21 21:09:57 -04:00
extents.c ext4: fix fdatasync(2) after extent manipulation operations 2017-05-29 13:24:55 -04:00
extents_status.c scripts/spelling.txt: add "comsume(r)" pattern and fix typo instances 2017-02-27 18:43:47 -08:00
extents_status.h ext4: move procfs registration code to fs/ext4/sysfs.c 2015-09-23 12:46:17 -04:00
file.c ext4: fix off-by-one on max nr_pages in ext4_find_unwritten_pgoff() 2017-05-24 18:02:20 -04:00
fsmap.c ext4: support GETFSMAP ioctls 2017-04-30 00:36:53 -04:00
fsmap.h ext4: support GETFSMAP ioctls 2017-04-30 00:36:53 -04:00
fsync.c ext4: add shutdown bit and check for it 2017-02-05 01:28:48 -05:00
hash.c ext4: move halfmd4 into hash.c directly 2017-02-02 11:52:14 -05:00
ialloc.c ext4: do not set posix acls on xattr inodes 2017-06-21 21:21:39 -04:00
indirect.c ext4: refactor direct IO code 2016-05-13 00:44:16 -04:00
inline.c ext4: xattr-in-inode support 2017-06-21 21:10:32 -04:00
inode.c ext4: fix lockdep warning about recursive inode locking 2017-06-21 21:17:10 -04:00
ioctl.c Add GETFSMAP support; some performance improvements for very large 2017-05-08 11:30:05 -07:00
Kconfig dax: fix build warnings with FS_DAX and !FS_IOMAP 2017-01-24 16:26:14 -08:00
Makefile ext4: support GETFSMAP ioctls 2017-04-30 00:36:53 -04:00
mballoc.c ext4: handle the rest of ext4_mb_load_buddy() ENOMEM errors 2017-05-21 22:35:23 -04:00
mballoc.h ext4: support GETFSMAP ioctls 2017-04-30 00:36:53 -04:00
migrate.c ext4: do not set posix acls on xattr inodes 2017-06-21 21:21:39 -04:00
mmp.c block,fs: use REQ_* flags directly 2016-11-01 09:43:26 -06:00
move_extent.c Fix a memory leak on an error path, and two races when modifying 2017-03-26 10:29:21 -07:00
namei.c ext4: add largedir feature 2017-06-21 21:09:57 -04:00
page-io.c ext4: replace BUG_ON with WARN_ONCE in ext4_end_bio() 2017-04-30 20:08:05 -04:00
readpage.c Merge branch 'akpm' (patches from Andrew) 2016-07-26 19:55:54 -07:00
resize.c ext4: rename s_resize_flags to s_ext4_flags 2017-02-05 01:27:48 -05:00
super.c ext4: fix quota charging for shared xattr blocks 2017-05-24 18:24:07 -04:00
symlink.c ext4: Add statx support 2017-04-03 01:05:58 -04:00
sysfs.c ext4: constify static data that is never modified 2017-04-29 23:47:50 -04:00
truncate.h ext4: fix races between page faults and hole punching 2015-12-07 14:28:03 -05:00
xattr.c ext4: attach jinode after creation of xattr inode 2017-06-21 21:24:31 -04:00
xattr.h ext4: fix lockdep warning about recursive inode locking 2017-06-21 21:17:10 -04:00
xattr_security.c switch xattr_handler->set() to passing dentry and inode separately 2016-05-27 15:39:43 -04:00
xattr_trusted.c switch xattr_handler->set() to passing dentry and inode separately 2016-05-27 15:39:43 -04:00
xattr_user.c switch xattr_handler->set() to passing dentry and inode separately 2016-05-27 15:39:43 -04:00