01 Aug, 2016

1 commit

  • The Hurd is using inode fields which restricts it from using more
    advanced ext4 file system features, due to design choices made over a
    decade ago. By giving the Hurd an extended attribute index field we
    allow it to move the translator and author fields out of the core
    inode fields, and hopefully we can get rid of ugly hacks such as
    EXT4_OS_HURD and EXT4_MOUNT2_HURD_COMPAT somday.

    For more information please see:
    https://summerofcode.withgoogle.com/projects/#5869799859027968

    Signed-off-by: Theodore Ts'o

    Theodore Ts'o
     

23 Feb, 2016

2 commits

  • Since old mbcache code is gone, let's rename new code to mbcache since
    number 2 is now meaningless. This is just a mechanical replacement.

    Signed-off-by: Jan Kara
    Signed-off-by: Theodore Ts'o

    Jan Kara
     
  • The conversion is generally straightforward. The only tricky part is
    that xattr block corresponding to found mbcache entry can get freed
    before we get buffer lock for that block. So we have to check whether
    the entry is still valid after getting buffer lock.

    Signed-off-by: Jan Kara
    Signed-off-by: Theodore Ts'o

    Jan Kara
     

11 Apr, 2015

1 commit


19 Mar, 2014

1 commit

  • This patch adds new interfaces to create and destory cache,
    ext4_xattr_create_cache() and ext4_xattr_destroy_cache(), and remove
    the cache creation and destory calls from ex4_init_xattr() and
    ext4_exitxattr() in fs/ext4/xattr.c.

    fs/ext4/super.c has been changed so that when a filesystem is mounted
    a cache is allocated and attched to its ext4_sb_info structure.

    fs/mbcache.c has been changed so that only one slab allocator is
    allocated and used by all mbcache structures.

    Signed-off-by: T. Makphaibulchoke

    T Makphaibulchoke
     

26 Jan, 2014

1 commit


19 Apr, 2013

1 commit

  • Jan Kara

    SUSE is carrying out of tree patches for Rich ACL support for ext4 as
    they didn't get upstream due to opposition of some VFS maintainers.
    Reserve xattr index for Rich ACLs so that it cannot be taken by
    anything else which would force users to backup and reset their Rich
    ACLs on files.

    Signed-off-by: Jan Kara
    Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     

10 Feb, 2013

1 commit

  • Operations which modify extended attributes may need extra journal
    credits if inline data is used, since there is a chance that some
    extended attributes may need to get pushed to an external attribute
    block.

    Changes to reflect this was made in xattr.c, but they were missed in
    fs/ext4/acl.c. To fix this, abstract the calculation of the number of
    credits needed for xattr operations to an inline function defined in
    ext4_jbd2.h, and use it in acl.c and xattr.c.

    Also move the function declarations used in inline.c from xattr.h
    (where they are non-obviously hidden, and caused problems since
    ext4_jbd2.h needs to use the function ext4_has_inline_data), and move
    them to ext4.h.

    Signed-off-by: "Theodore Ts'o"
    Reviewed-by: Tao Ma
    Reviewed-by: Jan Kara

    Theodore Ts'o
     

11 Dec, 2012

17 commits

  • Not all architectures (in particular, sparc64) have empty_zero_page.
    So instead of copying from empty_zero_page, use memset to clear the
    inline data by signalling to ext4_xattr_set_entry() via a magic
    pointer value, EXT4_ZERO_ATTR_VALUE, which is defined by casting -1 to
    a pointer.

    This fixes a build failure on sparc64, and the memset() should be more
    efficient than using memcpy() anyway.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Theodore Ts'o
     
  • Ted has sent out a RFC about removing this feature. Eric and Jan
    confirmed that both RedHat and SUSE enable this feature in all their
    product. David also said that "As far as I know, it's enabled in all
    Android kernels that use ext4." So it seems OK for us.

    And what's more, as inline data depends its implementation on xattr,
    and to be frank, I don't run any test again inline data enabled while
    xattr disabled. So I think we should add inline data and remove this
    config option in the same release.

    [ The savings if you disable CONFIG_EXT4_FS_XATTR is only 27k, which
    isn't much in the grand scheme of things. Since no one seems to be
    testing this configuration except for some automated compile farms, on
    balance we are better removing this config option, and so that it is
    effectively always enabled. -- tytso ]

    Cc: David Brown
    Cc: Eric Sandeen
    Reviewed-by: Jan Kara
    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • If we are punching hole in a file, we will return ENOTSUPP.
    As for the fallocation of some extents, we will convert the
    inline data to a normal extent based file first.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • Signed-off-by: Robin Dong
    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • Now we that store data in the inode, in case we need to store some
    xattrs and inode doesn't have enough space, Andreas suggested that we
    should keep the xattr(metadata) in and data should be pushed out. So
    this patch does the work.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • fiemap is used to find the disk layout of a file, as for inline data,
    let us just pretend like a file with just one extent.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • In case we rename a directory, ext4_rename has to read the dir block
    and change its dotdot's information. The old ext4_rename encapsulated
    the dir_block read into itself. So this patch adds a new function
    ext4_get_first_dir_block() which gets the dir buffer information so
    the ext4_rename can handle it properly. As it will also change the
    parent inode number, we return the parent_de so that ext4_rename() can
    handle it more easily.

    ext4_find_entry is also changed so that the caller(rename) can tell
    whether the found entry is an inlined one or not and journaling the
    corresponding buffer head.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • empty_dir is used when deleting a dir. So it should handle inline dir
    properly.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • Create a new function ext4_find_inline_entry() to handle the case of
    inline data.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • For "." and "..", we just call filldir by ourselves
    instead of iterating the real dir entry.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • This patch let add_dir_entry handle the inline data case. So the
    dir is initialized as inline dir first and then we can try to add
    some files to it, when the inline space can't hold all the entries,
    a dir block will be created and the dir entry will be moved to it.

    Also for an inlined dir, "." and ".." are removed and we only use
    4 bytes to store the parent inode number. These 2 entries will be
    added when we convert an inline dir to a block-based one.

    [ Folded in patch from Dan Carpenter to remove an unused variable. ]

    Signed-off-by: Tao Ma
    Signed-off-by: Dan Carpenter
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • For delayed allocation mode, we write to inline data if the file
    is small enough. And in case of we write to some offset larger
    than the inline size, the 1st page is dirtied, so that
    ext4_da_writepages can handle the conversion. When the 1st page
    is initialized with blocks, the inline part is removed.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • For a normal write case (not journalled write, not delayed
    allocation), we write to the inline if the file is small and convert
    it to an extent based file when the write is larger than the max
    inline size.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • Let readpage and readpages handle the case when we want to read an
    inlined file.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     
  • Implement inline data with xattr.

    Now we use "system.data" to store xattr, and the xattr will
    be extended if the i_size is increased while we don't release
    the space during truncate.

    Signed-off-by: Tao Ma
    Signed-off-by: "Theodore Ts'o"

    Tao Ma
     

05 Dec, 2012

1 commit


30 Apr, 2012

1 commit


02 Feb, 2011

1 commit

  • SELinux would like to implement a new labeling behavior of newly created
    inodes. We currently label new inodes based on the parent and the creating
    process. This new behavior would also take into account the name of the
    new object when deciding the new label. This is not the (supposed) full path,
    just the last component of the path.

    This is very useful because creating /etc/shadow is different than creating
    /etc/passwd but the kernel hooks are unable to differentiate these
    operations. We currently require that userspace realize it is doing some
    difficult operation like that and than userspace jumps through SELinux hoops
    to get things set up correctly. This patch does not implement new
    behavior, that is obviously contained in a seperate SELinux patch, but it
    does pass the needed name down to the correct LSM hook. If no such name
    exists it is fine to pass NULL.

    Signed-off-by: Eric Paris

    Eric Paris
     

29 Oct, 2010

1 commit

  • Commit 5dabfc78dced ("ext4: rename {exit,init}_ext4_*() to
    ext4_{exit,init}_*()") causes

    fs/ext4/super.c:4776: error: implicit declaration of function ‘ext4_init_xattr’

    when CONFIG_EXT4_FS_XATTR is disabled.

    It renamed init_ext4_xattr to ext4_init_xattr but forgot to update the
    dummy definition in fs/ext4/xattr.h.

    Signed-off-by: Ingo Molnar
    Acked-by: "Theodore Ts'o"
    Signed-off-by: Linus Torvalds

    Ingo Molnar
     

28 Oct, 2010

1 commit


22 May, 2010

1 commit


11 Oct, 2008

1 commit


09 Sep, 2008

1 commit


17 Apr, 2008

1 commit


18 Jul, 2007

1 commit

  • We need to make sure that existing ext3 filesystems can also avail the
    new fields that have been added to the ext4 inode. We use
    s_want_extra_isize and s_min_extra_isize to decide by how much we should
    expand the inode. If EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE feature is set
    then we expand the inode by max(s_want_extra_isize, s_min_extra_isize ,
    sizeof(ext4_inode) - EXT4_GOOD_OLD_INODE_SIZE) bytes. Actually it is
    still an open question about whether users should be able to set
    s_*_extra_isize smaller than the known fields or not.

    This patch also adds the functionality to expand inodes to include the
    newly added fields. We start by trying to expand by s_want_extra_isize
    bytes and if its fails we try to expand by s_min_extra_isize bytes. This
    is done by changing the i_extra_isize if enough space is available in
    the inode and no EAs are present. If EAs are present and there is enough
    space in the inode then the EAs in the inode are shifted to make space.
    If enough space is not available in the inode due to the EAs then 1 or
    more EAs are shifted to the external EA block. In the worst case when
    even the external EA block does not have enough space we inform the user
    that some EA would need to be deleted or s_min_extra_isize would have to
    be reduced.

    Signed-off-by: Andreas Dilger
    Signed-off-by: Kalpak Shah
    Signed-off-by: Mingming Cao
    Signed-off-by: "Theodore Ts'o"

    Kalpak Shah
     

12 Oct, 2006

2 commits