- Nov 10, 2018
-
-
Vasily Averin authored
According to Ted Ts'o ext4_getblk() called in ext4_xattr_inode_write() should not return bh = NULL The only time that bh could be NULL, then, would be in the case of something really going wrong; a programming error elsewhere (perhaps a wild pointer dereference) or I/O error causing on-disk file system corruption (although that would be highly unlikely given that we had *just* allocated the blocks and so the metadata blocks in question probably would still be in the cache). Fixes: e50e5129 ("ext4: xattr-in-inode support") Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 4.13
-
- Nov 08, 2018
-
-
Vasily Averin authored
Fixes: dc6982ff ("ext4: refactor code to read directory blocks ...") Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 3.9
-
Vasily Averin authored
Fixes: de05ca85 ("ext4: move call to ext4_error() into ...") Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 4.17
-
Vasily Averin authored
Fixes: 3f2571c1 ("ext4: factor out xattr moving") Fixes: 6dd4ee7c ("ext4: Expand extra_inodes space per ...") Reviewed-by:
Jan Kara <jack@suse.cz> Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 2.6.23
-
Vasily Averin authored
bs.bh was taken in previous ext4_xattr_block_find() call, it should be released before re-using Fixes: 7e01c8e5 ("ext3/4: fix uninitialized bs in ...") Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 2.6.26
-
Vasily Averin authored
Fixes: dec214d0 ("ext4: xattr inode deduplication") Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 4.13
-
- Nov 07, 2018
-
-
Vasily Averin authored
Fixes: c8585c6f ("ext4: fix races between changing inode journal ...") Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 4.7
-
Theodore Ts'o authored
Fixes: bfe0a5f4 ("ext4: add more mount time checks of the superblock") Reported-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 4.18
-
Vasily Averin authored
Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu>
-
Theodore Ts'o authored
Fixes: b4097142 ("ext4: add error checking to calls to ...") Reported-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 2.6.38
-
Vasily Averin authored
Fixes: d745a8c2 ("ext4: reduce contention on s_orphan_lock") Fixes: 6e3617e5 ("ext4: Handle non empty on-disk orphan link") Cc: Dmitry Monakhov <dmonakhov@gmail.com> Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 2.6.34
-
Vasily Averin authored
ext4_mark_iloc_dirty() callers expect that it releases iloc->bh even if it returns an error. Fixes: 0db1ff22 ("ext4: add shutdown bit and check for it") Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 4.11
-
Vasily Averin authored
Fixes: 1c6bd717 ("ext4: convert file system to meta_bg if needed ...") Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 3.7
-
Vasily Averin authored
Fixes: 117fff10 ("ext4: grow the s_flex_groups array as needed ...") Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 3.7
-
- Nov 04, 2018
-
-
Vasily Averin authored
Fixes: ac27a0ec ("ext4: initial copy of files from ext3") Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 2.6.19
-
Vasily Averin authored
Fixes: 01f795f9 ("ext4: add online resizing support for meta_bg ...") Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 3.7
-
Vasily Averin authored
Fixes: 33afdcc5 ("ext4: add a function which sets up group blocks ...") Cc: stable@kernel.org # 3.3 Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu>
-
Vasily Averin authored
Currently bh is set to NULL only during first iteration of for cycle, then this pointer is not cleared after end of using. Therefore rollback after errors can lead to extra brelse(bh) call, decrements bh counter and later trigger an unexpected warning in __brelse() Patch moves brelse() calls in body of cycle to exclude requirement of brelse() call in rollback. Fixes: 33afdcc5 ("ext4: add a function which sets up group blocks ...") Signed-off-by:
Vasily Averin <vvs@virtuozzo.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 3.3+
-
- Oct 12, 2018
-
-
Theodore Ts'o authored
It's possible for ext4_show_quota_options() to try reading s_qf_names[i] while it is being modified by ext4_remount() --- most notably, in ext4_remount's error path when the original values of the quota file name gets restored. Reported-by:
<syzbot+a2872d6feea6918008a9@syzkaller.appspotmail.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org # 3.2+
-
- Oct 07, 2018
-
-
Chengguang Xu authored
default_acl and acl of newly created inode will be initiated as ACL_NOT_CACHED in vfs function inode_init_always() and later will be updated by calling xxx_init_acl() in specific filesystems. However, when default_acl and acl are NULL then they keep the value of ACL_NOT_CACHED. This patch changes the code to cache NULL for acl / default_acl in this case to save unnecessary ACL lookup attempt. Signed-off-by:
Chengguang Xu <cgxu519@gmx.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Reviewed-by:
Jan Kara <jack@suse.cz>
-
- Oct 06, 2018
-
-
Darrick J. Wong authored
Move the ext4 data structures book to Documentation/filesystems/ext4/ since the administrative information moved elsewhere. Signed-off-by:
Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu>
-
Darrick J. Wong authored
Move the ext4 mount option and other administrative stuff to the Linux administrator's guide. Signed-off-by:
Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu>
-
Jan Kara authored
The code cleaning transaction's lists of checkpoint buffers has a bug where it increases bh refcount only after releasing journal->j_list_lock. Thus the following race is possible: CPU0 CPU1 jbd2_log_do_checkpoint() jbd2_journal_try_to_free_buffers() __journal_try_to_free_buffer(bh) ... while (transaction->t_checkpoint_io_list) ... if (buffer_locked(bh)) { <-- IO completes now, buffer gets unlocked --> spin_unlock(&journal->j_list_lock); spin_lock(&journal->j_list_lock); __jbd2_journal_remove_checkpoint(jh); spin_unlock(&journal->j_list_lock); try_to_free_buffers(page); get_bh(bh) <-- accesses freed bh Fix the problem by grabbing bh reference before unlocking journal->j_list_lock. Fixes: dc6e8d66 ("jbd2: don't call get_bh() before calling __jbd2_journal_remove_checkpoint()") Fixes: be1158cc ("jbd2: fold __process_buffer() into jbd2_log_do_checkpoint()") Reported-by:
<syzbot+7f4a27091759e2fe7453@syzkaller.appspotmail.com> CC: stable@vger.kernel.org Reviewed-by:
Lukas Czerner <lczerner@redhat.com> Signed-off-by:
Jan Kara <jack@suse.cz> Signed-off-by:
Theodore Ts'o <tytso@mit.edu>
-
- Oct 04, 2018
-
-
Wang Shilong authored
We return most failure of dquota_initialize() except inode evict, this could make a bit sense, for example we allow file removal even quota files are broken? But it dosen't make sense to allow setting project if quota files etc are broken. Signed-off-by:
Wang Shilong <wshilong@ddn.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org
-
- Oct 03, 2018
-
-
Wang Shilong authored
Currently, project quota could be changed by fssetxattr ioctl, and existed permission check inode_owner_or_capable() is obviously not enough, just think that common users could change project id of file, that could make users to break project quota easily. This patch try to follow same regular of xfs project quota: "Project Quota ID state is only allowed to change from within the init namespace. Enforce that restriction only if we are trying to change the quota ID state. Everything else is allowed in user namespaces." Besides that, check and set project id'state should be an atomic operation, protect whole operation with inode lock, ext4_ioctl_setproject() is only used for ioctl EXT4_IOC_FSSETXATTR, we have held mnt_want_write_file() before ext4_ioctl_setflags(), and ext4_ioctl_setproject() is called after ext4_ioctl_setflags(), we could share codes, so remove it inside ext4_ioctl_setproject(). Signed-off-by:
Wang Shilong <wshilong@ddn.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Reviewed-by:
Andreas Dilger <adilger@dilger.ca> Cc: stable@kernel.org
-
Darrick J. Wong authored
The tables in the ext4 readme are not particularly space efficient in the text or html outputs, and they're totally broken in the pdf output. Convert them into titled paragraphs so that they render more nicely. Signed-off-by:
Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu>
-
Darrick J. Wong authored
It turns out that the latex table formatters lay out table columns with the exact proportional widths given in the table metadata, even if text overflows outside the box. This was not caught during the initial import because the HTML renderers are smart enough to fudge the table. Fix the table column width formatting problems in the data structures and algorithms documentation so that we don't have squashed columns. Signed-off-by:
Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu>
-
Darrick J. Wong authored
The documentation build scripts won't build a pdf for the ext4 documentation unless explicitly called for, so ask for a separate ext4.pdf to be generated with all the documentation. Signed-off-by:
Darrick J. Wong <darrick.wong@oracle.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu>
-
Souptick Joarder authored
Return type of ext4_page_mkwrite and ext4_filemap_fault are changed to use vm_fault_t type. With this patch all the callers of block_page_mkwrite_return() are changed to handle vm_fault_t. So converting the return type of block_page_mkwrite_return() to vm_fault_t. Signed-off-by:
Souptick Joarder <jrdr.linux@gmail.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Reviewed-by:
Matthew Wilcox <willy@infradead.org>
-
Lukas Czerner authored
Variable retries is not initialized in ext4_da_write_inline_data_begin() which can lead to nondeterministic number of retries in case we hit ENOSPC. Initialize retries to zero as we do everywhere else. Signed-off-by:
Lukas Czerner <lczerner@redhat.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Fixes: bc0ca9df ("ext4: retry allocation when inline->extent conversion failed") Cc: stable@kernel.org
-
Theodore Ts'o authored
The code EXT4_IOC_SWAP_BOOT ioctl hasn't been updated in a while, and it's a bit broken with respect to more modern ext4 kernels, especially metadata checksums. Other problems fixed with this commit: * Don't allow installing a DAX, swap file, or an encrypted file as a boot loader. * Respect the immutable and append-only flags. * Wait until any DIO operations are finished *before* calling truncate_inode_pages(). * Don't swap inode->i_flags, since these flags have nothing to do with the inode blocks --- and it will give the IMA/audit code heartburn when the inode is evicted. Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org Reported-by:
<syzbot+e81ccd4744c6c4f71354@syzkaller.appspotmail.com>
-
Gabriel Krisman Bertazi authored
Enabling DX_DEBUG triggers the build error below. info is an attribute of the dxroot structure. linux/fs/ext4/namei.c:2264:12: error: ‘info’ undeclared (first use in this function); did you mean ‘insl’? info->indirect_levels)); Fixes: e08ac99f ("ext4: add largedir feature") Signed-off-by:
Gabriel Krisman Bertazi <krisman@collabora.co.uk> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Reviewed-by:
Lukas Czerner <lczerner@redhat.com>
-
- Oct 02, 2018
-
-
Theodore Ts'o authored
If the starting block number of either the source or destination file exceeds the EOF, EXT4_IOC_MOVE_EXT should return EINVAL. Also fixed the helper function mext_check_coverage() so that if the logical block is beyond EOF, make it return immediately, instead of looping until the block number wraps all the away around. This takes long enough that if there are multiple threads trying to do pound on an the same inode doing non-sensical things, it can end up triggering the kernel's soft lockup detector. Reported-by:
<syzbot+c61979f6f2cba5cb3c06@syzkaller.appspotmail.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu> Cc: stable@kernel.org
-
Eric Whitney authored
Add new code to count canceled pending cluster reservations on bigalloc file systems and to reduce the cluster reservation count on all file systems using delayed allocation. This replaces old code in ext4_da_page_release_reservations that was incorrect. Signed-off-by:
Eric Whitney <enwlinux@gmail.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu>
-
Eric Whitney authored
Modify ext4_ext_remove_space() and the code it calls to correct the reserved cluster count for pending reservations (delayed allocated clusters shared with allocated blocks) when a block range is removed from the extent tree. Pending reservations may be found for the clusters at the ends of written or unwritten extents when a block range is removed. If a physical cluster at the end of an extent is freed, it's necessary to increment the reserved cluster count to maintain correct accounting if the corresponding logical cluster is shared with at least one delayed and unwritten extent as found in the extents status tree. Add a new function, ext4_rereserve_cluster(), to reapply a reservation on a delayed allocated cluster sharing blocks with a freed allocated cluster. To avoid ENOSPC on reservation, a flag is applied to ext4_free_blocks() to briefly defer updating the freeclusters counter when an allocated cluster is freed. This prevents another thread from allocating the freed block before the reservation can be reapplied. Redefine the partial cluster object as a struct to carry more state information and to clarify the code using it. Adjust the conditional code structure in ext4_ext_remove_space to reduce the indentation level in the main body of the code to improve readability. Signed-off-by:
Eric Whitney <enwlinux@gmail.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu>
-
Eric Whitney authored
Ext4 does not always reduce the reserved cluster count by the number of clusters allocated when mapping a delayed extent. It sometimes adds back one or more clusters after allocation if delalloc blocks adjacent to the range allocated by ext4_ext_map_blocks() share the clusters newly allocated for that range. However, this overcounts the number of clusters needed to satisfy future mapping requests (holding one or more reservations for clusters that have already been allocated) and premature ENOSPC and quota failures, etc., result. Ext4 also does not reduce the reserved cluster count when allocating clusters for non-delayed allocated writes that have previously been reserved for delayed writes. This also results in overcounts. To make it possible to handle reserved cluster accounting for fallocated regions in the same manner as used for other non-delayed writes, do the reserved cluster accounting for them at the time of allocation. In the current code, this is only done later when a delayed extent sharing the fallocated region is finally mapped. Address comment correcting handling of unsigned long long constant from Jan Kara's review of RFC version of this patch. Signed-off-by:
Eric Whitney <enwlinux@gmail.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu>
-
Eric Whitney authored
The code in ext4_da_map_blocks sometimes reserves space for more delayed allocated clusters than it should, resulting in premature ENOSPC, exceeded quota, and inaccurate free space reporting. Fix this by checking for written and unwritten blocks shared in the same cluster with the newly delayed allocated block. A cluster reservation should not be made for a cluster for which physical space has already been allocated. Signed-off-by:
Eric Whitney <enwlinux@gmail.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu>
-
Eric Whitney authored
Add new pending reservation mechanism to help manage reserved cluster accounting. Its primary function is to avoid the need to read extents from the disk when invalidating pages as a result of a truncate, punch hole, or collapse range operation. Signed-off-by:
Eric Whitney <enwlinux@gmail.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu>
-
Eric Whitney authored
Ext4 contains a few functions that are used to search for delayed extents or blocks in the extents status tree. Rather than duplicate code to add new functions to search for extents with different status values, such as written or a combination of delayed and unwritten, generalize the existing code to search for caller-specified extents status values. Also, move this code into extents_status.c where it is better associated with the data structures it operates upon, and where it can be more readily used to implement new extents status tree functions that might want a broader scope for i_es_lock. Three missing static specifiers in RFC version of patch reported and fixed by Fengguang Wu <fengguang.wu@intel.com>. Signed-off-by:
Eric Whitney <enwlinux@gmail.com> Signed-off-by:
Theodore Ts'o <tytso@mit.edu>
-
- Sep 30, 2018
-
-
Greg Kroah-Hartman authored
-