]> git.baikalelectronics.ru Git - kernel.git/commit
btrfs: handle transaction start error in btrfs_fileattr_set
authorRitesh Harjani <riteshh@linux.ibm.com>
Fri, 30 Apr 2021 16:00:55 +0000 (21:30 +0530)
committerDavid Sterba <dsterba@suse.com>
Tue, 11 May 2021 13:35:57 +0000 (15:35 +0200)
commite0e64e2d0f7080c9c2ada9478f76d76b23e14249
treed8fd041f106d8844c3a3d905b024ef38ab53d35c
parent9fb51bb203ba1c67f480638e9d0605db59810687
btrfs: handle transaction start error in btrfs_fileattr_set

Add error handling in btrfs_fileattr_set in case of an error while
starting a transaction. This fixes btrfs/232 which otherwise used to
fail with below signature on Power.

  btrfs/232 [ 1119.474650] run fstests btrfs/232 at 2021-04-21 02:21:22
  <...>
  [ 1366.638585] BUG: Unable to handle kernel data access on read at 0xffffffffffffff86
  [ 1366.638768] Faulting instruction address: 0xc0000000009a5c88
  cpu 0x0: Vector: 380 (Data SLB Access) at [c000000014f177b0]
      pc: c0000000009a5c88: btrfs_update_root_times+0x58/0xc0
      lr: c0000000009a5c84: btrfs_update_root_times+0x54/0xc0
      <...>
      pid   = 24881, comm = fsstress
   btrfs_update_inode+0xa0/0x140
   btrfs_fileattr_set+0x5d0/0x6f0
   vfs_fileattr_set+0x2a8/0x390
   do_vfs_ioctl+0x1290/0x1ac0
   sys_ioctl+0x6c/0x120
   system_call_exception+0x3d4/0x410
   system_call_common+0xec/0x278

Fixes: 96ed188faa0d ("btrfs: convert to fileattr")
Signed-off-by: Ritesh Harjani <riteshh@linux.ibm.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/ioctl.c