03 Aug, 2020

1 commit

  • Rationale:
    Reduces attack surface on kernel devs opening the links for MITM
    as HTTPS traffic is much harder to manipulate.

    Deterministic algorithm:
    For each file:
    If not .svg:
    For each line:
    If doesn't contain `\bxmlns\b`:
    For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
    If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
    If both the HTTP and HTTPS versions
    return 200 OK and serve the same content:
    Replace HTTP with HTTPS.

    Reviewed-by: Gao Xiang
    Reviewed-by: Chao Yu
    Signed-off-by: Alexander A. Klimov
    Link: https://lore.kernel.org/r/20200713130944.34419-1-grandmaster@al2klimov.de
    Signed-off-by: Gao Xiang

    Alexander A. Klimov
     

29 May, 2020

1 commit

  • Convert the erofs to use new internal mount API as the old one will
    be obsoleted and removed. This allows greater flexibility in
    communication of mount parameters between userspace, the VFS and the
    filesystem.

    See Documentation/filesystems/mount_api.txt for more information.

    Cc: Al Viro
    Cc: David Howells
    Signed-off-by: Chao Yu
    Link: https://lore.kernel.org/r/20200529104836.17843-1-hsiangkao@redhat.com
    Signed-off-by: Gao Xiang

    Chao Yu
     

03 Mar, 2020

1 commit

  • XArray has friendly APIs and it will replace the old radix
    tree in the near future.

    This convert makes use of __xa_cmpxchg when inserting on
    a just inserted item by other thread. In detail, instead
    of totally looking up again as what we did for the old
    radix tree, it will try to legitimize the current in-tree
    item in the XArray therefore more effective.

    In addition, naming is rather a challenge for non-English
    speaker like me. The basic idea of workstn is to provide
    a runtime sparse array with items arranged in the physical
    block number order. Such items (was called workgroup) can be
    used to record compress clusters or for later new features.

    However, both workgroup and workstn seem not good names from
    whatever point of view, so I'd like to rename them as pslot
    and managed_pslots to stand for physical slots. This patch
    handles the second as a part of the radix tree convert.

    Cc: Matthew Wilcox
    Link: https://lore.kernel.org/r/20200220024642.91529-1-gaoxiang25@huawei.com
    Reviewed-by: Chao Yu
    Signed-off-by: Gao Xiang

    Gao Xiang
     

07 Jan, 2020

2 commits

  • All workgroups are registered with tag value set to 0, to simplify
    erofs_register_workgroup() interface the tag argument can be removed,
    if its only value is sent down to the function body.

    Signed-off-by: Vladimir Zapolskiy
    Link: https://lore.kernel.org/r/20200102120118.14979-3-vladimir@tuxera.com
    Reviewed-by: Chao Yu
    Signed-off-by: Gao Xiang

    Vladimir Zapolskiy
     
  • It is feasible to simplify erofs_find_workgroup() interface by removing
    an unused function argument. While formally the argument is used in the
    function itself, its assigned value is ignored on the caller side.

    Signed-off-by: Vladimir Zapolskiy
    Link: https://lore.kernel.org/r/20200102120118.14979-2-vladimir@tuxera.com
    Reviewed-by: Chao Yu
    Signed-off-by: Gao Xiang

    Vladimir Zapolskiy
     

24 Nov, 2019

3 commits

  • VLE was an old informal name of fixed-sized output
    compression which came from published ATC'19 paper [1].

    Drop those old annotations since erofs can handle
    all encoded clusters in block-aligned basis, which
    is wider than fixed-sized output compression after
    larger clustersize feature is fully implemented.

    Unaligned encoding won't be considered in EROFS
    since it's not friendly to inplace I/O and perhaps
    decompression inplace.

    a) Fixed-sized output compression with 16KB pcluster:
    ___________________________________
    |xxxxxxxx|xxxxxxxx|xxxxxxxx|xxxxxxxx|
    |___ 0___|___ 1___|___ 2___|___ 3___| physical blocks

    b) Block-aligned fixed-sized input compression with
    16KB pcluster:
    ___________________________________
    |xxxxxxxx|xxxxxxxx|xxxxxxxx|xxx00000|
    |___ 0___|___ 1___|___ 2___|___ 3___| physical blocks

    c) Block-unaligned fixed-sized input compression with
    16KB compression unit:
    ____________________________________________
    |..xxxxxx|xxxxxxxx|xxxxxxxx|xxxxxxxx|x.......|
    |___ 0___|___ 1___|___ 2___|___ 3___|___ 4___| physical blocks

    Refine better names for those as well.

    [1] https://www.usenix.org/conference/atc19/presentation/gao

    Link: https://lore.kernel.org/r/20191108033733.63919-1-gaoxiang25@huawei.com
    Reviewed-by: Chao Yu
    Signed-off-by: Gao Xiang

    Gao Xiang
     
  • Introduce superblock checksum feature in order to
    check at mounting time.

    Note that the first 1024 bytes are ignore for x86
    boot sectors and other oddities.

    Link: https://lore.kernel.org/r/20191104024937.113939-1-gaoxiang25@huawei.com
    Signed-off-by: Pratik Shinde
    Reviewed-by: Chao Yu
    Cc: Dan Carpenter
    Signed-off-by: Gao Xiang

    Pratik Shinde
     
  • Now open code is much cleaner due to iterative development.

    Link: https://lore.kernel.org/r/20191124025217.12345-1-hsiangkao@aol.com
    Reviewed-by: Chao Yu
    Signed-off-by: Gao Xiang

    Gao Xiang
     

06 Sep, 2019

10 commits

  • Add prefix "erofs_" to these functions and print
    sb->s_id as a prefix to erofs_{err, info} so that
    the user knows which file system is affected.

    Reported-by: Christoph Hellwig
    Signed-off-by: Gao Xiang
    Link: https://lore.kernel.org/r/20190904020912.63925-23-gaoxiang25@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    Gao Xiang
     
  • As Christoph suggested [1], "Please just use plain kmalloc
    everywhere and let the normal kernel error injection code
    take care of injeting any errors."

    [1] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/
    Reported-by: Christoph Hellwig
    Signed-off-by: Gao Xiang
    Link: https://lore.kernel.org/r/20190904020912.63925-20-gaoxiang25@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    Gao Xiang
     
  • Add erofs_ prefix to free_inode, alloc_inode, ...

    Reported-by: Christoph Hellwig
    Signed-off-by: Gao Xiang
    Link: https://lore.kernel.org/r/20190904020912.63925-19-gaoxiang25@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    Gao Xiang
     
  • As Christoph pointed out [1], "
    Why is there __submit_bio which really just obsfucates
    what is going on? Also why is __submit_bio using
    bio_set_op_attrs instead of opencode it as the comment
    right next to it asks you to? "

    Let's use submit_bio directly instead.

    [1] https://lore.kernel.org/r/20190830162812.GA10694@infradead.org/
    Reported-by: Christoph Hellwig
    Signed-off-by: Gao Xiang
    Link: https://lore.kernel.org/r/20190904020912.63925-18-gaoxiang25@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    Gao Xiang
     
  • As Christoph pointed out [1],
    "Why is there __erofs_get_meta_page with the two weird
    booleans instead of a single erofs_get_meta_page that
    gets and gfp_t for additional flags and an unsigned int
    for additional bio op flags."

    And since all callers can handle errors, let's kill
    prio and nofail and erofs_get_inline_page() now.

    [1] https://lore.kernel.org/r/20190830162812.GA10694@infradead.org/
    Reported-by: Christoph Hellwig
    Signed-off-by: Gao Xiang
    Link: https://lore.kernel.org/r/20190904020912.63925-17-gaoxiang25@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    Gao Xiang
     
  • As Christoph pointed out [1], "erofs_grab_bio tries to
    handle a bio_alloc failure, except that the function will
    not actually fail due the mempool backing it."

    Sorry about useless code, fix it now and
    localize erofs_grab_bio [2].

    [1] https://lore.kernel.org/r/20190830162812.GA10694@infradead.org/
    [2] https://lore.kernel.org/r/20190902122016.GL15931@infradead.org/
    Reported-by: Christoph Hellwig
    Signed-off-by: Gao Xiang
    Link: https://lore.kernel.org/r/20190904020912.63925-16-gaoxiang25@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    Gao Xiang
     
  • Fix as Christoph suggested [1] [2], "remove is_inode_fast_symlink
    and just opencode it in the few places using it"

    and
    "Please just set the ops directly instead of obsfucating that in
    a single caller, single line inline function. And please set it
    instead of the normal symlink iops in the same place where you
    also set those."

    [1] https://lore.kernel.org/r/20190830163910.GB29603@infradead.org/
    [2] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/
    Reported-by: Christoph Hellwig
    Signed-off-by: Gao Xiang
    Link: https://lore.kernel.org/r/20190904020912.63925-13-gaoxiang25@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    Gao Xiang
     
  • As Christoph suggested [1], "Why is this called vnode instead
    of inode? That seems like a rather odd naming for a Linux
    file system."

    [1] https://lore.kernel.org/r/20190829101545.GC20598@infradead.org/
    Reported-by: Christoph Hellwig
    Signed-off-by: Gao Xiang
    Link: https://lore.kernel.org/r/20190904020912.63925-10-gaoxiang25@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    Gao Xiang
     
  • updates inode naming
    - kill is_inode_layout_compression [1]
    - kill magic underscores [2] [3]
    - better naming for datamode & data_mapping_mode [3]
    - better naming erofs_inode_{compact, extended} [4]

    [1] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/
    [2] https://lore.kernel.org/r/20190829102426.GE20598@infradead.org/
    [3] https://lore.kernel.org/r/20190902122627.GN15931@infradead.org/
    [4] https://lore.kernel.org/r/20190902125438.GA17750@infradead.org/
    Reported-by: Christoph Hellwig
    Signed-off-by: Gao Xiang
    Link: https://lore.kernel.org/r/20190904020912.63925-8-gaoxiang25@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    Gao Xiang
     
  • As Christoph said [1], "This is only cosmetic, why
    not stick to feature_compat and feature_incompat?"

    In my thought, requirements means "incompatible"
    instead of "feature" though.

    [1] https://lore.kernel.org/r/20190902125109.GA9826@infradead.org/
    Reported-by: Christoph Hellwig
    Signed-off-by: Gao Xiang
    Link: https://lore.kernel.org/r/20190904020912.63925-7-gaoxiang25@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    Gao Xiang
     

30 Aug, 2019

1 commit

  • As Dan Carpenter suggested [1], I have to remove
    all erofs likely/unlikely annotations.

    [1] https://lore.kernel.org/linux-fsdevel/20190829154346.GK23584@kadam/
    Reported-by: Dan Carpenter
    Signed-off-by: Gao Xiang
    Link: https://lore.kernel.org/r/20190829163827.203274-1-gaoxiang25@huawei.com
    Signed-off-by: Greg Kroah-Hartman

    Gao Xiang
     

24 Aug, 2019

1 commit

  • EROFS filesystem has been merged into linux-staging for a year.

    EROFS is designed to be a better solution of saving extra storage
    space with guaranteed end-to-end performance for read-only files
    with the help of reduced metadata, fixed-sized output compression
    and decompression inplace technologies.

    In the past year, EROFS was greatly improved by many people as
    a staging driver, self-tested, betaed by a large number of our
    internal users, successfully applied to almost all in-service
    HUAWEI smartphones as the part of EMUI 9.1 and proven to be stable
    enough to be moved out of staging.

    EROFS is a self-contained filesystem driver. Although there are
    still some TODOs to be more generic, we have a dedicated team
    actively keeping on working on EROFS in order to make it better
    with the evolution of Linux kernel as the other in-kernel filesystems.

    As Pavel suggested, it's better to do as one commit since git
    can do moves and all histories will be saved in this way.

    Let's promote it from staging and enhance it more actively as
    a "real" part of kernel for more wider scenarios!

    Cc: Greg Kroah-Hartman
    Cc: Alexander Viro
    Cc: Andrew Morton
    Cc: Stephen Rothwell
    Cc: Theodore Ts'o
    Cc: Pavel Machek
    Cc: David Sterba
    Cc: Amir Goldstein
    Cc: Christoph Hellwig
    Cc: Darrick J . Wong
    Cc: Dave Chinner
    Cc: Jaegeuk Kim
    Cc: Jan Kara
    Cc: Richard Weinberger
    Cc: Linus Torvalds
    Cc: Chao Yu
    Cc: Miao Xie
    Cc: Li Guifu
    Cc: Fang Wei
    Signed-off-by: Gao Xiang
    Link: https://lore.kernel.org/r/20190822213659.5501-1-hsiangkao@aol.com
    Signed-off-by: Greg Kroah-Hartman

    Gao Xiang