linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anand Jain <anand.jain@oracle.com>
To: dsterba@suse.cz,
	Christoph Biedl <linux-kernel.bfrz@manchmal.in-ulm.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Liu Bo <bo.li.liu@oracle.com>,
	linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH 4.14 024/110] btrfs: use proper endianness accessors for super_copy
Date: Tue, 20 Mar 2018 17:32:56 +0800	[thread overview]
Message-ID: <b14fedbb-55d1-815c-eaa5-c69b5d785615@oracle.com> (raw)
In-Reply-To: <20180319193221.GP6955@suse.cz>



On 03/20/2018 03:32 AM, David Sterba wrote:
> On Sat, Mar 17, 2018 at 06:27:15PM +0100, Christoph Biedl wrote:
>> Greg Kroah-Hartman wrote...
>>
>>> On Thu, Mar 15, 2018 at 07:55:42PM +0100, Christoph Biedl wrote:
>>
>>>>> commit 3c181c12c431fe33b669410d663beb9cceefcd1b upstream.
>>
>>>> On big-endian systems, this change intruduces severe corruption,
>>>> resulting in complete loss of the data on the used block device.
>>
>>> That sucks.  Can you test Linus's tree to verify the problem is there?
>>> I'll gladly revert this if Linus's tree also gets the revert, I don't
>>> want you to hit this when you upgrade to a newer kernel.
>>
>> Confirmed: The problem is, err ... was in Linus' tree as well. The
>> rather recent commit 8f5fd927c3a7 reverted the change, after that
>> everything is as expected again.
> 
> Thanks for checking.
> 
>> Looking at the original commit, I don't have a clue why things go wrong
>> so horribly
> 
> It's a half endianness conversion. The plain in-memory structures are in
> LE and has to be accessed via the helpers, super block copy and the
> root item.  The commit adds only one half of the conversion, that
> naturally does not exhibit on LE, because the macros are no-op.
> 
> Originally, the items were stored from the on-disk type to on-disk type,
> regardless of the CPU:
> 
>    super->chunk_root = root_item->bytenr;
> 
> The patch should have added conversion of both values, like
> 
>    btrfs_set_super_chunk_root(super, btrfs_root_bytenr(root_item));
> 
> and not
> 
>    btrfs_set_super_chunk_root(super, root_item->bytenr);
> 
> It's not very obvious from the context though, typically there's one
> structure that needs the accessors and is set from a value that's in CPU
> byteorder. I think that the exception to this pattern confused all
> involved developers.
> 
> The root_item members are annotated as __le64 that should be caught by
> sparse/smatch checker in the buggy case, but we don't run the checkers
> every the time.

  Ah! the RC is at the other side of the equation.
  Makes sense to me. Thanks.

>> - otherwise don't be afraid of my data. I took this as a
>> chance to verify my data recovery procedure, with success.
> 
> Should that not be the case, the damaged items in superblock can be
> byteswapped back. That's 6 x u64 at most, I have a tool for that now.
> 
> Thanks again for the report and sorry for the trouble.

  It's entirely my mistake. My apologies for the inconvenience.

Thanks, Anand


> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2018-03-20  9:32 UTC|newest]

Thread overview: 129+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-07 19:37 [PATCH 4.14 000/110] 4.14.25-stable review Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 001/110] Bluetooth: btusb: Use DMI matching for QCA reset_resume quirking Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 002/110] ixgbe: fix crash in build_skb Rx code path Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 003/110] tpm: st33zp24: fix potential buffer overruns caused by bit glitches on the bus Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 004/110] tpm: " Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 005/110] tpm_i2c_infineon: " Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 006/110] tpm_i2c_nuvoton: " Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 007/110] tpm_tis: " Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 008/110] tpm: constify transmit data pointers Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 009/110] tpm_tis_spi: Use DMA-safe memory for SPI transfers Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 010/110] ALSA: usb-audio: Add a quirck for B&W PX headphones Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 011/110] ALSA: control: Fix memory corruption risk in snd_ctl_elem_read Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 012/110] ALSA: x86: Fix missing spinlock and mutex initializations Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 013/110] ALSA: hda: Add a power_save blacklist Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 014/110] ALSA: hda - Fix pincfg at resume on Lenovo T470 dock Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 015/110] mmc: sdhci-pci: Fix S0i3 for Intel BYT-based controllers Greg Kroah-Hartman
2018-03-07 19:37 ` [PATCH 4.14 016/110] mmc: dw_mmc-k3: Fix out-of-bounds access through DT alias Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 017/110] mmc: dw_mmc: Avoid accessing registers in runtime suspended state Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 018/110] mmc: dw_mmc: Factor out dw_mci_init_slot_caps Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 019/110] mmc: dw_mmc: Fix out-of-bounds access for slots caps Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 020/110] timers: Forward timer base before migrating timers Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 021/110] parisc: Use cr16 interval timers unconditionally on qemu Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 022/110] parisc: Reduce irq overhead when run in qemu Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 023/110] parisc: Fix ordering of cache and TLB flushes Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 024/110] btrfs: use proper endianness accessors for super_copy Greg Kroah-Hartman
2018-03-15 18:55   ` Christoph Biedl
2018-03-16 12:30     ` Greg Kroah-Hartman
2018-03-16 13:22       ` David Sterba
2018-03-16 14:02         ` Greg Kroah-Hartman
2018-03-16 16:21           ` Anand Jain
2018-03-17 17:27       ` Christoph Biedl
2018-03-19 19:32         ` David Sterba
2018-03-20  9:32           ` Anand Jain [this message]
2018-03-16 16:21     ` Anand Jain
2018-03-07 19:38 ` [PATCH 4.14 025/110] block: fix the count of PGPGOUT for WRITE_SAME Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 026/110] block: kyber: fix domain token leak during requeue Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 027/110] vfio: disable filesystem-dax page pinning Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 028/110] cpufreq: s3c24xx: Fix broken s3c_cpufreq_init() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 029/110] dax: fix vma_is_fsdax() helper Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 030/110] direct-io: Fix sleep in atomic due to sync AIO Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 031/110] x86/xen: Zero MSR_IA32_SPEC_CTRL before suspend Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 032/110] x86/platform/intel-mid: Handle Intel Edison reboot correctly Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 033/110] x86/cpu_entry_area: Sync cpu_entry_area to initial_page_table Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 034/110] bridge: check brport attr show in brport_show Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 035/110] fib_semantics: Dont match route with mismatching tclassid Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 036/110] hdlc_ppp: carrier detect ok, dont turn off negotiation Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 037/110] ipv6 sit: work around bogus gcc-8 -Wrestrict warning Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 038/110] net: amd-xgbe: fix comparison to bitshift when dealing with a mask Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 039/110] net: ethernet: ti: cpsw: fix net watchdog timeout Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 040/110] net: fix race on decreasing number of TX queues Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 041/110] net: ipv4: dont allow setting net.ipv4.route.min_pmtu below 68 Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 042/110] netlink: ensure to loop over all netns in genlmsg_multicast_allns() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 043/110] net: sched: report if filter is too large to dump Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 044/110] ppp: prevent unregistered channels from connecting to PPP units Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 045/110] sctp: verify size of a new chunk in _sctp_make_chunk() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 046/110] udplite: fix partial checksum initialization Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 047/110] net/mlx5e: Fix TCP checksum in LRO buffers Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 048/110] sctp: fix dst refcnt leak in sctp_v4_get_dst Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 049/110] mlxsw: spectrum_switchdev: Check success of FDB add operation Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 050/110] net/mlx5e: Specify numa node when allocating drop rq Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 051/110] net: phy: fix phy_start to consider PHY_IGNORE_INTERRUPT Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 052/110] tcp: Honor the eor bit in tcp_mtu_probe Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 053/110] rxrpc: Fix send in rxrpc_send_data_packet() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 054/110] tcp_bbr: better deal with suboptimal GSO Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 055/110] doc: Change the min default value of tcp_wmem/tcp_rmem Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 056/110] net/mlx5e: Fix loopback self test when GRO is off Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 057/110] net_sched: gen_estimator: fix broken estimators based on percpu stats Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 058/110] net/sched: cls_u32: fix cls_u32 on filter replace Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 059/110] sctp: do not pr_err for the duplicated node in transport rhlist Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 060/110] tcp: revert F-RTO middle-box workaround Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 061/110] tcp: revert F-RTO extension to detect more spurious timeouts Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 062/110] mlxsw: spectrum_router: Fix error path in mlxsw_sp_vr_create Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 063/110] net: ipv4: Set addr_type in hash_keys for forwarded case Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 064/110] sctp: fix dst refcnt leak in sctp_v6_get_dst() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 065/110] bridge: Fix VLAN reference count problem Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 066/110] net/mlx5e: Verify inline header size do not exceed SKB linear size Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 067/110] amd-xgbe: Restore PCI interrupt enablement setting on resume Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 068/110] cls_u32: fix use after free in u32_destroy_key() Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 069/110] mlxsw: spectrum_router: Do not unconditionally clear route offload indication Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 070/110] netlink: put module reference if dump start fails Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 071/110] tcp: purge write queue upon RST Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 072/110] tuntap: correctly add the missing XDP flush Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 073/110] tuntap: disable preemption during XDP processing Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 074/110] virtio-net: disable NAPI only when enabled during XDP set Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 075/110] s390/qeth: fix underestimated count of buffer elements Greg Kroah-Hartman
2018-03-07 19:38 ` [PATCH 4.14 076/110] s390/qeth: fix SETIP command handling Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 077/110] s390/qeth: fix overestimated count of buffer elements Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 078/110] s390/qeth: fix IP removal on offline cards Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 079/110] s390/qeth: fix double-free on IP add/remove race Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 080/110] Revert "s390/qeth: fix using of ref counter for rxip addresses" Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 081/110] s390/qeth: fix IP address lookup for L3 devices Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 082/110] s390/qeth: fix IPA command submission race Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 083/110] blk-mq: dont call io scheds .requeue_request when requeueing rq to ->dispatch Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 084/110] media: m88ds3103: dont call a non-initalized function Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 085/110] EDAC, sb_edac: Fix out of bound writes during DIMM configuration on KNL Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 086/110] KVM: s390: take care of clock-comparator sign control Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 087/110] KVM: s390: provide only a single function for setting the tod (fix SCK) Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 088/110] KVM: s390: consider epoch index on hotplugged CPUs Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 089/110] KVM: s390: consider epoch index on TOD clock syncs Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 090/110] nospec: Allow index argument to have const-qualified type Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 091/110] x86/mm: Fix {pmd,pud}_{set,clear}_flags() Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 092/110] ARM: orion: fix orion_ge00_switch_board_info initialization Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 093/110] ARM: dts: rockchip: Remove 1.8 GHz operation point from phycore som Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 094/110] ARM: mvebu: Fix broken PL310_ERRATA_753970 selects Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 095/110] ARM: kvm: fix building with gcc-8 Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 096/110] KVM: x86: extend usage of RET_MMIO_PF_* constants Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 097/110] KVM: X86: Fix SMRAM accessing even if VM is shutdown Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 098/110] KVM: mmu: Fix overlap between public and private memslots Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 099/110] KVM/x86: Remove indirect MSR op calls from SPEC_CTRL Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 100/110] KVM: x86: move LAPIC initialization after VMCS creation Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 101/110] KVM/VMX: Optimize vmx_vcpu_run() and svm_vcpu_run() by marking the RDMSR path as unlikely() Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 102/110] KVM: x86: fix vcpu initialization with userspace lapic Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 103/110] PCI/ASPM: Deal with missing root ports in link state handling Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 104/110] KVM/x86: Fix wrong macro references of X86_CR0_PG_BIT and X86_CR4_PAE_BIT in kvm_valid_sregs() Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 105/110] KVM/x86: remove WARN_ON() for when vm_munmap() fails Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 106/110] ACPI / bus: Parse tables as term_list for Dell XPS 9570 and Precision M5530 Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 107/110] ARM: dts: LogicPD SOM-LV: Fix I2C1 pinmux Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 108/110] ARM: dts: LogicPD Torpedo: " Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 109/110] md: only allow remove_and_add_spares when no sync_thread running Greg Kroah-Hartman
2018-03-07 19:39 ` [PATCH 4.14 110/110] nvme-rdma: dont suppress send completions Greg Kroah-Hartman
2018-03-07 23:57 ` [PATCH 4.14 000/110] 4.14.25-stable review Shuah Khan
2018-03-08  4:19 ` kernelci.org bot
2018-03-09  0:05   ` Kevin Hilman
2018-03-09  1:09     ` Greg Kroah-Hartman
2018-03-09  8:02     ` Quentin Schulz
2018-03-09 17:49       ` Kevin Hilman
2018-03-08  8:36 ` Naresh Kamboju
2018-03-08 12:00   ` Naresh Kamboju
2018-03-08 14:22 ` Guenter Roeck

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b14fedbb-55d1-815c-eaa5-c69b5d785615@oracle.com \
    --to=anand.jain@oracle.com \
    --cc=bo.li.liu@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel.bfrz@manchmal.in-ulm.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).