mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Re: [PATCH 3.2 16/52] ext4, jbd2: ensure entering into panic after recording an error in superblock
@ 2015-11-27  5:23 Daeho Jeong
  0 siblings, 0 replies; 2+ messages in thread
From: Daeho Jeong @ 2015-11-27  5:23 UTC (permalink / raw)
  To: Ben Hutchings, linux-kernel, stable
  Cc: akpm, Theodore Ts'o, 우호빈,
	정대호

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=utf-8, Size: 3680 bytes --]

It looks good. Thank you. :-)

------- Original Message -------
Sender : Ben Hutchings<ben@decadent.org.uk>
Date : 2015-11-25 07:33 (GMT+09:00)
Title : [PATCH 3.2 16/52] ext4, jbd2: ensure entering into panic after recording an error in superblock

3.2.74-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Daeho Jeong 

commit 4327ba52afd03fc4b5afa0ee1d774c9c5b0e85c5 upstream.

If a EXT4 filesystem utilizes JBD2 journaling and an error occurs, the
journaling will be aborted first and the error number will be recorded
into JBD2 superblock and, finally, the system will enter into the
panic state in "errors=panic" option.  But, in the rare case, this
sequence is little twisted like the below figure and it will happen
that the system enters into panic state, which means the system reset
in mobile environment, before completion of recording an error in the
journal superblock. In this case, e2fsck cannot recognize that the
filesystem failure occurred in the previous run and the corruption
wouldn't be fixed.

Task A                        Task B
ext4_handle_error()
-> jbd2_journal_abort()
  -> __journal_abort_soft()
    -> __jbd2_journal_abort_hard()
    | -> journal->j_flags |= JBD2_ABORT;
    |
    |                         __ext4_abort()
    |                         -> jbd2_journal_abort()
    |                         | -> __journal_abort_soft()
    |                         |   -> if (journal->j_flags & JBD2_ABORT)
    |                         |           return;
    |                         -> panic()
    |
    -> jbd2_journal_update_sb_errno()

Tested-by: Hobin Woo 
Signed-off-by: Daeho Jeong 
Signed-off-by: Theodore Ts'o 
Signed-off-by: Ben Hutchings 
---
fs/ext4/super.c      | 12 ++++++++++--
fs/jbd2/journal.c    |  6 +++++-
include/linux/jbd2.h |  1 +
3 files changed, 16 insertions(+), 3 deletions(-)

--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -463,9 +463,13 @@ static void ext4_handle_error(struct sup
ext4_msg(sb, KERN_CRIT, "Remounting filesystem read-only");
sb->s_flags |= MS_RDONLY;
}
- if (test_opt(sb, ERRORS_PANIC))
+ if (test_opt(sb, ERRORS_PANIC)) {
+ if (EXT4_SB(sb)->s_journal &&
+   !(EXT4_SB(sb)->s_journal->j_flags & JBD2_REC_ERR))
+ return;
panic("EXT4-fs (device %s): panic forced after error\n",
sb->s_id);
+ }
}

void __ext4_error(struct super_block *sb, const char *function,
@@ -628,8 +632,12 @@ void __ext4_abort(struct super_block *sb
jbd2_journal_abort(EXT4_SB(sb)->s_journal, -EIO);
save_error_info(sb, function, line);
}
- if (test_opt(sb, ERRORS_PANIC))
+ if (test_opt(sb, ERRORS_PANIC)) {
+ if (EXT4_SB(sb)->s_journal &&
+   !(EXT4_SB(sb)->s_journal->j_flags & JBD2_REC_ERR))
+ return;
panic("EXT4-fs panic from previous error\n");
+ }
}

void ext4_msg(struct super_block *sb, const char *prefix, const char *fmt, ...)
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -1956,8 +1956,12 @@ static void __journal_abort_soft (journa

__jbd2_journal_abort_hard(journal);

- if (errno)
+ if (errno) {
jbd2_journal_update_sb_errno(journal);
+ write_lock(&journal->j_state_lock);
+ journal->j_flags |= JBD2_REC_ERR;
+ write_unlock(&journal->j_state_lock);
+ }
}

/**
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -954,6 +954,7 @@ struct journal_s
#define JBD2_ABORT_ON_SYNCDATA_ERR 0x040 /* Abort the journal on file
* data write error in ordered
* mode */
+#define JBD2_REC_ERR 0x080 /* The errno in the sb has been recorded */

/*
  * Function declarations for the journaling transaction and bufferÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ\x17¥Šwÿº{.nÇ+‰·¥Š{±þG«éÿŠ{ayº\x1dʇڙë,j\a­¢f£¢·hšïêÿ‘êçz_è®\x03(­éšŽŠÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?™¨è­Ú&£ø§~á¶iO•æ¬z·švØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?–I¥

^ permalink raw reply	[flat|nested] 2+ messages in thread
* [PATCH 3.2 00/52] 3.2.74-rc1 review
@ 2015-11-24 22:33 Ben Hutchings
  2015-11-24 22:33 ` [PATCH 3.2 16/52] ext4, jbd2: ensure entering into panic after recording an error in superblock Ben Hutchings
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Hutchings @ 2015-11-24 22:33 UTC (permalink / raw)
  To: linux-kernel, stable; +Cc: torvalds, Guenter Roeck, Phil Jensen, akpm

This is the start of the stable review cycle for the 3.2.74 release.
There are 52 patches in this series, which will be posted as responses
to this one.  If anyone has any issues with these being applied, please
let me know.

Responses should be made by Fri Nov 27 00:00:00 UTC 2015.
Anything received after that time might be too late.

A combined patch relative to 3.2.73 will be posted as an additional
response to this.  A shortlog and diffstat can be found below.

Ben.

-------------

Alex Williamson (2):
      PCI: Fix devfn for VPD access through function 0
         [9d9240756e63dd87d6cbf5da8b98ceb8f8192b55]
      PCI: Use function 0 VPD for identical functions, regular VPD for others
         [da2d03ea27f6ed9d2005a67b20dd021ddacf1e4d]

Ani Sinha (1):
      ipmr: fix possible race resulting from improper usage  of IP_INC_STATS_BH() in preemptible context.
         [44f49dd8b5a606870a1f21101522a0f9c4414784]

Arnd Bergmann (1):
      ARM: pxa: remove incorrect __init annotation on pxa27x_set_pwrmode
         [54c09889bff6d99c8733eed4a26c9391b177c88b]

Bart Van Assche (1):
      scsi: Fix a bdi reregistration race
         [bf2cf3baa20b0a6cd2d08707ef05dc0e992a8aa0]

Boris BREZILLON (1):
      mtd: mtdpart: fix add_mtd_partitions error path
         [e5bae86797141e4a95e42d825f737cb36d7b8c37]

Borislav Petkov (1):
      x86/cpu: Call verify_cpu() after having entered long mode too
         [04633df0c43d710e5f696b06539c100898678235]

Brian Norris (1):
      mtd: blkdevs: fix potential deadlock + lockdep warnings
         [f3c63795e90f0c6238306883b6c72f14d5355721]

Chen Yu (1):
      ACPI: Use correct IRQ when uninstalling ACPI interrupt handler
         [49e4b84333f338d4f183f28f1f3c1131b9fb2b5a]

Chris Mason (1):
      Btrfs: don't use ram_bytes for uncompressed inline items
         [514ac8ad8793a097c0c9d89202c642479d6dfa34]

Christoph Hellwig (1):
      scsi: restart list search after unlock in scsi_remove_target
         [40998193560dab6c3ce8d25f4fa58a23e252ef38]

Christophe Leroy (1):
      splice: sendfile() at once fails for big files
         [0ff28d9f4674d781e492bcff6f32f0fe48cf0fed]

Daeho Jeong (1):
      ext4, jbd2: ensure entering into panic after recording an error in superblock
         [4327ba52afd03fc4b5afa0ee1d774c9c5b0e85c5]

Dan Carpenter (3):
      devres: fix a for loop bounds check
         [1f35d04a02a652f14566f875aef3a6f2af4cb77b]
      irda: precedence bug in irlmp_seq_hb_idx()
         [50010c20597d14667eff0fdb628309986f195230]
      mwifiex: fix mwifiex_rdeeprom_read()
         [1f9c6e1bc1ba5f8a10fcd6e99d170954d7c6d382]

David Howells (1):
      FS-Cache: Handle a write to the page immediately beyond the EOF marker
         [102f4d900c9c8f5ed89ae4746d493fe3ebd7ba64]

David Woodhouse (1):
      iommu/vt-d: Fix ATSR handling for Root-Complex integrated endpoints
         [d14053b3c714178525f22660e6aaf41263d00056]

Dmitry Tunin (2):
      Bluetooth: ath3k: Add new AR3012 0930:021c id
         [cd355ff071cd37e7197eccf9216770b2b29369f7]
      Bluetooth: ath3k: Add support of AR3012 0cf3:817b device
         [18e0afab8ce3f1230ce3fef52b2e73374fd9c0e7]

Eric Dumazet (3):
      net: avoid NULL deref in inet_ctl_sock_destroy()
         [8fa677d2706d325d71dab91bf6e6512c05214e37]
      net: fix a race in dst_release()
         [d69bbf88c8d0b367cf3e3a052f6daadf630ee566]
      packet: fix match_fanout_group()
         [161642e24fee40fba2c5bc2ceacc00d118a22d65]

Filipe Manana (5):
      Btrfs: fix file corruption and data loss after cloning inline extents
         [8039d87d9e473aeb740d4fdbd59b9d2f89b2ced9]
      Btrfs: fix race leading to BUG_ON when running delalloc for nodatacow
         [1d512cb77bdbda80f0dd0620a3b260d697fd581d]
      Btrfs: fix race leading to incorrect item deletion when dropping extents
         [aeafbf8486c9e2bd53f5cc3c10c0b7fd7149d69c]
      Btrfs: fix race when listing an inode's xattrs
         [f1cd1f0b7d1b5d4aaa5711e8f4e4898b0045cb6d]
      Btrfs: fix truncation of compressed and inlined extents
         [0305cd5f7fca85dae392b9ba85b116896eb7c1c7]

Herbert Xu (1):
      crypto: algif_hash - Only export and import on sockets with data
         [4afa5f9617927453ac04b24b584f6c718dfb4f45]

Jan Schmidt (1):
      Btrfs: added helper btrfs_next_item()
         [c7d22a3c3cdb73d8a0151e2ccc8cf4a48c48310b]

Jann Horn (1):
      fs: if a coredump already exists, unlink and recreate with O_EXCL
         [fbb1816942c04429e85dbf4c1a080accc534299e]

Johannes Berg (1):
      mac80211: fix driver RSSI event calculations
         [8ec6d97871f37e4743678ea4a455bd59580aa0f4]

Kees Cook (1):
      fs: make dumpable=2 require fully qualified path
         [9520628e8ceb69fa9a4aee6b57f22675d9e1b709]

Kinglong Mee (2):
      FS-Cache: Don't override netfs's primary_index if registering failed
         [b130ed5998e62879a66bad08931a2b5e832da95c]
      FS-Cache: Increase reference of parent after registering, netfs success
         [86108c2e34a26e4bec3c6ddb23390bf8cedcf391]

Larry Finger (1):
      staging: rtl8712: Add device ID for Sitecom WLA2100
         [1e6e63283691a2a9048a35d9c6c59cf0abd342e4]

Libin (1):
      recordmcount: Fix endianness handling bug for nop_mcount
         [c84da8b9ad3761eef43811181c7e896e9834b26b]

Maciej W. Rozycki (1):
      binfmt_elf: Don't clobber passed executable's file header
         [b582ef5c53040c5feef4c96a8f9585b6831e2441]

Marek Vasut (1):
      can: Use correct type in sizeof() in nla_put()
         [562b103a21974c2f9cd67514d110f918bb3e1796]

Michal Kubeček (1):
      ipv6: fix tunnel error handling
         [ebac62fe3d24c0ce22dd83afa7b07d1a2aaef44d]

Paolo Bonzini (1):
      KVM: svm: unconditionally intercept #DB
         [cbdb967af3d54993f5814f1cee0ed311a055377d]

Peter Oberparleiter (1):
      scsi_sysfs: Fix queue_ramp_up_period return code
         [863e02d0e173bb9d8cea6861be22820b25c076cc]

Peter Zijlstra (1):
      perf: Fix inherited events vs. tracepoint filters
         [b71b437eedaed985062492565d9d421d975ae845]

Ralf Baechle (1):
      MIPS: atomic: Fix comment describing atomic64_add_unless's return value.
         [f0a232cde7be18a207fd057dd79bbac8a0a45dec]

Richard Purdie (1):
      HID: core: Avoid uninitialized buffer access
         [79b568b9d0c7c5d81932f4486d50b38efdd6da6d]

Sowmini Varadhan (1):
      RDS-TCP: Recover correctly from pskb_pull()/pksb_trim()  failure in rds_tcp_data_recv
         [8ce675ff39b9958d1c10f86cf58e357efaafc856]

Stefan Richter (1):
      firewire: ohci: fix JMicron JMB38x IT context discovery
         [100ceb66d5c40cc0c7018e06a9474302470be73c]

Sumit.Saxena@Avagotech.Com (2):
      megaraid_sas : SMAP restriction--do not access user memory from IOCTL code
         [323c4a02c631d00851d8edc4213c4d184ef83647]
      megaraid_sas: Do not use PAGE_SIZE for max_sectors
         [357ae967ad66e357f78b5cfb5ab6ca07fb4a7758]

Takashi Iwai (2):
      ALSA: hda - Apply pin fixup for HP ProBook 6550b
         [c932b98c1e47312822d911c1bb76e81ef50e389c]
      ALSA: hda - Disable 64bit address for Creative HDA controllers
         [cadd16ea33a938d49aee99edd4758cc76048b399]

Valentin Rothberg (1):
      wm831x_power: Use IRQF_ONESHOT to request threaded IRQs
         [90adf98d9530054b8e665ba5a928de4307231d84]

 Documentation/sysctl/fs.txt               |  18 ++-
 Makefile                                  |   4 +-
 arch/arm/mach-pxa/include/mach/pxa27x.h   |   2 +-
 arch/arm/mach-pxa/pxa27x.c                |   2 +-
 arch/mips/include/asm/atomic.h            |   2 +-
 arch/x86/kernel/head_64.S                 |   8 ++
 arch/x86/kernel/verify_cpu.S              |  12 +-
 arch/x86/kvm/svm.c                        |  25 +---
 crypto/algif_hash.c                       |  12 +-
 drivers/acpi/osl.c                        |   9 +-
 drivers/bluetooth/ath3k.c                 |   4 +
 drivers/bluetooth/btusb.c                 |   2 +
 drivers/firewire/ohci.c                   |   5 +
 drivers/hid/hid-core.c                    |   2 +-
 drivers/iommu/intel-iommu.c               |   7 +-
 drivers/mtd/mtd_blkdevs.c                 |  10 +-
 drivers/mtd/mtdpart.c                     |   4 +-
 drivers/net/can/dev.c                     |   2 +-
 drivers/net/wireless/mwifiex/debugfs.c    |  14 +--
 drivers/pci/access.c                      |  27 +----
 drivers/pci/quirks.c                      |  20 +++-
 drivers/power/wm831x_power.c              |   6 +-
 drivers/scsi/megaraid/megaraid_sas.h      |   2 +
 drivers/scsi/megaraid/megaraid_sas_base.c |  15 ++-
 drivers/scsi/scsi_sysfs.c                 |  32 ++---
 drivers/staging/rtl8712/usb_intf.c        |   1 +
 fs/binfmt_elf.c                           |  10 +-
 fs/btrfs/ctree.h                          |  39 +++++--
 fs/btrfs/file.c                           |  18 ++-
 fs/btrfs/inode.c                          |  91 ++++++++++++---
 fs/btrfs/ioctl.c                          | 188 ++++++++++++++++++++++++------
 fs/btrfs/print-tree.c                     |   2 +-
 fs/btrfs/tree-log.c                       |   2 +-
 fs/btrfs/xattr.c                          |   4 +-
 fs/cachefiles/rdwr.c                      |  78 +++++++------
 fs/exec.c                                 |  49 +++++++-
 fs/ext4/super.c                           |  12 +-
 fs/fscache/netfs.c                        |  34 +++---
 fs/fscache/page.c                         |   2 +-
 fs/jbd2/journal.c                         |   6 +-
 fs/splice.c                               |  12 +-
 include/linux/acpi.h                      |   6 +
 include/linux/jbd2.h                      |   1 +
 include/net/inet_common.h                 |   3 +-
 kernel/events/core.c                      |   4 +
 lib/devres.c                              |   2 +-
 net/core/dst.c                            |   2 +-
 net/ipv4/ipmr.c                           |   4 +-
 net/ipv6/tunnel6.c                        |  12 +-
 net/irda/irlmp.c                          |   2 +-
 net/mac80211/mlme.c                       |   2 +-
 net/packet/af_packet.c                    |   6 +-
 net/rds/tcp_recv.c                        |  11 +-
 scripts/recordmcount.h                    |   2 +-
 sound/pci/hda/hda_intel.c                 |   2 +
 sound/pci/hda/patch_sigmatel.c            |   1 +
 56 files changed, 596 insertions(+), 258 deletions(-)

-- 
Ben Hutchings
Unix is many things to many people,
but it's never been everything to anybody.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-11-27  5:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-11-27  5:23 [PATCH 3.2 16/52] ext4, jbd2: ensure entering into panic after recording an error in superblock Daeho Jeong
  -- strict thread matches above, loose matches on Subject: below --
2015-11-24 22:33 [PATCH 3.2 00/52] 3.2.74-rc1 review Ben Hutchings
2015-11-24 22:33 ` [PATCH 3.2 16/52] ext4, jbd2: ensure entering into panic after recording an error in superblock Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome