1. 08 8月, 2020 7 次提交
  2. 06 8月, 2020 2 次提交
    • L
      ext4: handle read only external journal device · 273108fa
      Lukas Czerner 提交于
      Ext4 uses blkdev_get_by_dev() to get the block_device for journal device
      which does check to see if the read-only block device was opened
      read-only.
      
      As a result ext4 will hapily proceed mounting the file system with
      external journal on read-only device. This is bad as we would not be
      able to use the journal leading to errors later on.
      
      Instead of simply failing to mount file system in this case, treat it in
      a similar way we treat internal journal on read-only device. Allow to
      mount with -o noload in read-only mode.
      
      This can be reproduced easily like this:
      
      mke2fs -F -O journal_dev $JOURNAL_DEV 100M
      mkfs.$FSTYPE -F -J device=$JOURNAL_DEV $FS_DEV
      blockdev --setro $JOURNAL_DEV
      mount $FS_DEV $MNT
      touch $MNT/file
      umount $MNT
      
      leading to error like this
      
      [ 1307.318713] ------------[ cut here ]------------
      [ 1307.323362] generic_make_request: Trying to write to read-only block-device dm-2 (partno 0)
      [ 1307.331741] WARNING: CPU: 36 PID: 3224 at block/blk-core.c:855 generic_make_request_checks+0x2c3/0x580
      [ 1307.341041] Modules linked in: ext4 mbcache jbd2 rfkill intel_rapl_msr intel_rapl_common isst_if_commd
      [ 1307.419445] CPU: 36 PID: 3224 Comm: jbd2/dm-2 Tainted: G        W I       5.8.0-rc5 #2
      [ 1307.427359] Hardware name: Dell Inc. PowerEdge R740/01KPX8, BIOS 2.3.10 08/15/2019
      [ 1307.434932] RIP: 0010:generic_make_request_checks+0x2c3/0x580
      [ 1307.440676] Code: 94 03 00 00 48 89 df 48 8d 74 24 08 c6 05 cf 2b 18 01 01 e8 7f a4 ff ff 48 c7 c7 50e
      [ 1307.459420] RSP: 0018:ffffc0d70eb5fb48 EFLAGS: 00010286
      [ 1307.464646] RAX: 0000000000000000 RBX: ffff9b33b2978300 RCX: 0000000000000000
      [ 1307.471780] RDX: ffff9b33e12a81e0 RSI: ffff9b33e1298000 RDI: ffff9b33e1298000
      [ 1307.478913] RBP: ffff9b7b9679e0c0 R08: 0000000000000837 R09: 0000000000000024
      [ 1307.486044] R10: 0000000000000000 R11: ffffc0d70eb5f9f0 R12: 0000000000000400
      [ 1307.493177] R13: 0000000000000000 R14: 0000000000000001 R15: 0000000000000000
      [ 1307.500308] FS:  0000000000000000(0000) GS:ffff9b33e1280000(0000) knlGS:0000000000000000
      [ 1307.508396] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 1307.514142] CR2: 000055eaf4109000 CR3: 0000003dee40a006 CR4: 00000000007606e0
      [ 1307.521273] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [ 1307.528407] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [ 1307.535538] PKRU: 55555554
      [ 1307.538250] Call Trace:
      [ 1307.540708]  generic_make_request+0x30/0x340
      [ 1307.544985]  submit_bio+0x43/0x190
      [ 1307.548393]  ? bio_add_page+0x62/0x90
      [ 1307.552068]  submit_bh_wbc+0x16a/0x190
      [ 1307.555833]  jbd2_write_superblock+0xec/0x200 [jbd2]
      [ 1307.560803]  jbd2_journal_update_sb_log_tail+0x65/0xc0 [jbd2]
      [ 1307.566557]  jbd2_journal_commit_transaction+0x2ae/0x1860 [jbd2]
      [ 1307.572566]  ? check_preempt_curr+0x7a/0x90
      [ 1307.576756]  ? update_curr+0xe1/0x1d0
      [ 1307.580421]  ? account_entity_dequeue+0x7b/0xb0
      [ 1307.584955]  ? newidle_balance+0x231/0x3d0
      [ 1307.589056]  ? __switch_to_asm+0x42/0x70
      [ 1307.592986]  ? __switch_to_asm+0x36/0x70
      [ 1307.596918]  ? lock_timer_base+0x67/0x80
      [ 1307.600851]  kjournald2+0xbd/0x270 [jbd2]
      [ 1307.604873]  ? finish_wait+0x80/0x80
      [ 1307.608460]  ? commit_timeout+0x10/0x10 [jbd2]
      [ 1307.612915]  kthread+0x114/0x130
      [ 1307.616152]  ? kthread_park+0x80/0x80
      [ 1307.619816]  ret_from_fork+0x22/0x30
      [ 1307.623400] ---[ end trace 27490236265b1630 ]---
      Signed-off-by: NLukas Czerner <lczerner@redhat.com>
      Reviewed-by: NAndreas Dilger <adilger@dilger.ca>
      Link: https://lore.kernel.org/r/20200717090605.2612-1-lczerner@redhat.comSigned-off-by: NTheodore Ts'o <tytso@mit.edu>
      273108fa
    • J
      ext4: don't BUG on inconsistent journal feature · 11215630
      Jan Kara 提交于
      A customer has reported a BUG_ON in ext4_clear_journal_err() hitting
      during an LTP testing. Either this has been caused by a test setup
      issue where the filesystem was being overwritten while LTP was mounting
      it or the journal replay has overwritten the superblock with invalid
      data. In either case it is preferable we don't take the machine down
      with a BUG_ON. So handle the situation of unexpectedly missing
      has_journal feature more gracefully. We issue warning and fail the mount
      in the cases where the race window is narrow and the failed check is
      most likely a programming error. In cases where fs corruption is more
      likely, we do full ext4_error() handling before failing mount / remount.
      Reviewed-by: NLukas Czerner <lczerner@redhat.com>
      Signed-off-by: NJan Kara <jack@suse.cz>
      Link: https://lore.kernel.org/r/20200710140759.18031-1-jack@suse.czSigned-off-by: NTheodore Ts'o <tytso@mit.edu>
      11215630
  3. 13 6月, 2020 1 次提交
  4. 11 6月, 2020 2 次提交
  5. 10 6月, 2020 1 次提交
  6. 04 6月, 2020 1 次提交
  7. 29 5月, 2020 5 次提交
  8. 22 5月, 2020 1 次提交
  9. 19 5月, 2020 1 次提交
    • E
      fscrypt: support test_dummy_encryption=v2 · ed318a6c
      Eric Biggers 提交于
      v1 encryption policies are deprecated in favor of v2, and some new
      features (e.g. encryption+casefolding) are only being added for v2.
      
      Therefore, the "test_dummy_encryption" mount option (which is used for
      encryption I/O testing with xfstests) needs to support v2 policies.
      
      To do this, extend its syntax to be "test_dummy_encryption=v1" or
      "test_dummy_encryption=v2".  The existing "test_dummy_encryption" (no
      argument) also continues to be accepted, to specify the default setting
      -- currently v1, but the next patch changes it to v2.
      
      To cleanly support both v1 and v2 while also making it easy to support
      specifying other encryption settings in the future (say, accepting
      "$contents_mode:$filenames_mode:v2"), make ext4 and f2fs maintain a
      pointer to the dummy fscrypt_context rather than using mount flags.
      
      To avoid concurrency issues, don't allow test_dummy_encryption to be set
      or changed during a remount.  (The former restriction is new, but
      xfstests doesn't run into it, so no one should notice.)
      
      Tested with 'gce-xfstests -c {ext4,f2fs}/encrypt -g auto'.  On ext4,
      there are two regressions, both of which are test bugs: ext4/023 and
      ext4/028 fail because they set an xattr and expect it to be stored
      inline, but the increase in size of the fscrypt_context from
      24 to 40 bytes causes this xattr to be spilled into an external block.
      
      Link: https://lore.kernel.org/r/20200512233251.118314-4-ebiggers@kernel.orgAcked-by: NJaegeuk Kim <jaegeuk@kernel.org>
      Reviewed-by: NTheodore Ts'o <tytso@mit.edu>
      Signed-off-by: NEric Biggers <ebiggers@google.com>
      ed318a6c
  10. 14 5月, 2020 1 次提交
  11. 07 5月, 2020 1 次提交
  12. 16 4月, 2020 2 次提交
  13. 02 4月, 2020 1 次提交
  14. 29 3月, 2020 3 次提交
  15. 26 3月, 2020 3 次提交
    • E
      ext4: do not commit super on read-only bdev · c96e2b85
      Eric Sandeen 提交于
      Under some circumstances we may encounter a filesystem error on a
      read-only block device, and if we try to save the error info to the
      superblock and commit it, we'll wind up with a noisy error and
      backtrace, i.e.:
      
      [ 3337.146838] EXT4-fs error (device pmem1p2): ext4_get_journal_inode:4634: comm mount: inode #0: comm mount: iget: illegal inode #
      ------------[ cut here ]------------
      generic_make_request: Trying to write to read-only block-device pmem1p2 (partno 2)
      WARNING: CPU: 107 PID: 115347 at block/blk-core.c:788 generic_make_request_checks+0x6b4/0x7d0
      ...
      
      To avoid this, commit the error info in the superblock only if the
      block device is writable.
      Reported-by: NRitesh Harjani <riteshh@linux.ibm.com>
      Signed-off-by: NEric Sandeen <sandeen@redhat.com>
      Reviewed-by: NAndreas Dilger <adilger@dilger.ca>
      Link: https://lore.kernel.org/r/4b6e774d-cc00-3469-7abb-108eb151071a@sandeen.netSigned-off-by: NTheodore Ts'o <tytso@mit.edu>
      c96e2b85
    • R
      ext4: unregister sysfs path before destroying jbd2 journal · 5e47868f
      Ritesh Harjani 提交于
      Call ext4_unregister_sysfs(), before destroying jbd2 journal,
      since below might cause, NULL pointer dereference issue.
      This got reported with LTP tests.
      
      ext4_put_super() 		cat /sys/fs/ext4/loop2/journal_task
      	| 				ext4_attr_show();
      ext4_jbd2_journal_destroy();  			|
          	|				 journal_task_show()
      	| 					|
      	| 				task_pid_vnr(NULL);
      sbi->s_journal = NULL;
      Signed-off-by: NRitesh Harjani <riteshh@linux.ibm.com>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Link: https://lore.kernel.org/r/20200318061301.4320-1-riteshh@linux.ibm.comSigned-off-by: NTheodore Ts'o <tytso@mit.edu>
      5e47868f
    • R
      ext4: check for non-zero journal inum in ext4_calculate_overhead · f1eec3b0
      Ritesh Harjani 提交于
      While calculating overhead for internal journal, also check
      that j_inum shouldn't be 0. Otherwise we get below error with
      xfstests generic/050 with external journal (XXX_LOGDEV config) enabled.
      
      It could be simply reproduced with loop device with an external journal
      and marking blockdev as RO before mounting.
      
      [ 3337.146838] EXT4-fs error (device pmem1p2): ext4_get_journal_inode:4634: comm mount: inode #0: comm mount: iget: illegal inode #
      ------------[ cut here ]------------
      generic_make_request: Trying to write to read-only block-device pmem1p2 (partno 2)
      WARNING: CPU: 107 PID: 115347 at block/blk-core.c:788 generic_make_request_checks+0x6b4/0x7d0
      CPU: 107 PID: 115347 Comm: mount Tainted: G             L   --------- -t - 4.18.0-167.el8.ppc64le #1
      NIP:  c0000000006f6d44 LR: c0000000006f6d40 CTR: 0000000030041dd4
      <...>
      NIP [c0000000006f6d44] generic_make_request_checks+0x6b4/0x7d0
      LR [c0000000006f6d40] generic_make_request_checks+0x6b0/0x7d0
      <...>
      Call Trace:
      generic_make_request_checks+0x6b0/0x7d0 (unreliable)
      generic_make_request+0x3c/0x420
      submit_bio+0xd8/0x200
      submit_bh_wbc+0x1e8/0x250
      __sync_dirty_buffer+0xd0/0x210
      ext4_commit_super+0x310/0x420 [ext4]
      __ext4_error+0xa4/0x1e0 [ext4]
      __ext4_iget+0x388/0xe10 [ext4]
      ext4_get_journal_inode+0x40/0x150 [ext4]
      ext4_calculate_overhead+0x5a8/0x610 [ext4]
      ext4_fill_super+0x3188/0x3260 [ext4]
      mount_bdev+0x778/0x8f0
      ext4_mount+0x28/0x50 [ext4]
      mount_fs+0x74/0x230
      vfs_kern_mount.part.6+0x6c/0x250
      do_mount+0x2fc/0x1280
      sys_mount+0x158/0x180
      system_call+0x5c/0x70
      EXT4-fs (pmem1p2): no journal found
      EXT4-fs (pmem1p2): can't get journal size
      EXT4-fs (pmem1p2): mounted filesystem without journal. Opts: dax,norecovery
      
      Fixes: 3c816ded ("ext4: use journal inode to determine journal overhead")
      Reported-by: NHarish Sriram <harish@linux.ibm.com>
      Signed-off-by: NRitesh Harjani <riteshh@linux.ibm.com>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Link: https://lore.kernel.org/r/20200316093038.25485-1-riteshh@linux.ibm.comSigned-off-by: NTheodore Ts'o <tytso@mit.edu>
      f1eec3b0
  16. 25 3月, 2020 1 次提交
  17. 24 3月, 2020 1 次提交
    • C
      block: remove __bdevname · ea3edd4d
      Christoph Hellwig 提交于
      There is no good reason for __bdevname to exist.  Just open code
      printing the string in the callers.  For three of them the format
      string can be trivially merged into existing printk statements,
      and in init/do_mounts.c we can at least do the scnprintf once at
      the start of the function, and unconditional of CONFIG_BLOCK to
      make the output for tiny configfs a little more helpful.
      
      Acked-by: Theodore Ts'o <tytso@mit.edu> # for ext4
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      ea3edd4d
  18. 06 3月, 2020 1 次提交
  19. 01 3月, 2020 1 次提交
  20. 22 2月, 2020 3 次提交
  21. 21 2月, 2020 1 次提交