--- /dev/null
+From 483028edacab374060d93955382b4865a9e07cba Mon Sep 17 00:00:00 2001
+From: Shawn Guo <shawn.guo@linaro.org>
+Date: Wed, 17 Mar 2021 14:36:06 +0800
+Subject: efivars: respect EFI_UNSUPPORTED return from firmware
+
+From: Shawn Guo <shawn.guo@linaro.org>
+
+commit 483028edacab374060d93955382b4865a9e07cba upstream.
+
+As per UEFI spec 2.8B section 8.2, EFI_UNSUPPORTED may be returned by
+EFI variable runtime services if no variable storage is supported by
+firmware. In this case, there is no point for kernel to continue
+efivars initialization. That said, efivar_init() should fail by
+returning an error code, so that efivarfs will not be mounted on
+/sys/firmware/efi/efivars at all. Otherwise, user space like efibootmgr
+will be confused by the EFIVARFS_MAGIC seen there, while EFI variable
+calls cannot be made successfully.
+
+Cc: <stable@vger.kernel.org> # v5.10+
+Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
+Acked-by: Ard Biesheuvel <ardb@kernel.org>
+Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/firmware/efi/vars.c | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+--- a/drivers/firmware/efi/vars.c
++++ b/drivers/firmware/efi/vars.c
+@@ -485,6 +485,10 @@ int efivar_init(int (*func)(efi_char16_t
+ }
+
+ break;
++ case EFI_UNSUPPORTED:
++ err = -EOPNOTSUPP;
++ status = EFI_NOT_FOUND;
++ break;
+ case EFI_NOT_FOUND:
+ break;
+ default:
--- /dev/null
+From 6b22489911b726eebbf169caee52fea52013fbdd Mon Sep 17 00:00:00 2001
+From: "zhangyi (F)" <yi.zhang@huawei.com>
+Date: Fri, 5 Mar 2021 20:05:08 +0800
+Subject: ext4: do not try to set xattr into ea_inode if value is empty
+
+From: zhangyi (F) <yi.zhang@huawei.com>
+
+commit 6b22489911b726eebbf169caee52fea52013fbdd upstream.
+
+Syzbot report a warning that ext4 may create an empty ea_inode if set
+an empty extent attribute to a file on the file system which is no free
+blocks left.
+
+ WARNING: CPU: 6 PID: 10667 at fs/ext4/xattr.c:1640 ext4_xattr_set_entry+0x10f8/0x1114 fs/ext4/xattr.c:1640
+ ...
+ Call trace:
+ ext4_xattr_set_entry+0x10f8/0x1114 fs/ext4/xattr.c:1640
+ ext4_xattr_block_set+0x1d0/0x1b1c fs/ext4/xattr.c:1942
+ ext4_xattr_set_handle+0x8a0/0xf1c fs/ext4/xattr.c:2390
+ ext4_xattr_set+0x120/0x1f0 fs/ext4/xattr.c:2491
+ ext4_xattr_trusted_set+0x48/0x5c fs/ext4/xattr_trusted.c:37
+ __vfs_setxattr+0x208/0x23c fs/xattr.c:177
+ ...
+
+Now, ext4 try to store extent attribute into an external inode if
+ext4_xattr_block_set() return -ENOSPC, but for the case of store an
+empty extent attribute, store the extent entry into the extent
+attribute block is enough. A simple reproduce below.
+
+ fallocate test.img -l 1M
+ mkfs.ext4 -F -b 2048 -O ea_inode test.img
+ mount test.img /mnt
+ dd if=/dev/zero of=/mnt/foo bs=2048 count=500
+ setfattr -n "user.test" /mnt/foo
+
+Reported-by: syzbot+98b881fdd8ebf45ab4ae@syzkaller.appspotmail.com
+Fixes: 9c6e7853c531 ("ext4: reserve space for xattr entries/names")
+Cc: stable@kernel.org
+Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
+Link: https://lore.kernel.org/r/20210305120508.298465-1-yi.zhang@huawei.com
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/ext4/xattr.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/ext4/xattr.c
++++ b/fs/ext4/xattr.c
+@@ -2400,7 +2400,7 @@ retry_inode:
+ * external inode if possible.
+ */
+ if (ext4_has_feature_ea_inode(inode->i_sb) &&
+- !i.in_inode) {
++ i.value_len && !i.in_inode) {
+ i.in_inode = 1;
+ goto retry_inode;
+ }
--- /dev/null
+From b7ff91fd030dc9d72ed91b1aab36e445a003af4f Mon Sep 17 00:00:00 2001
+From: "zhangyi (F)" <yi.zhang@huawei.com>
+Date: Wed, 3 Mar 2021 21:17:02 +0800
+Subject: ext4: find old entry again if failed to rename whiteout
+
+From: zhangyi (F) <yi.zhang@huawei.com>
+
+commit b7ff91fd030dc9d72ed91b1aab36e445a003af4f upstream.
+
+If we failed to add new entry on rename whiteout, we cannot reset the
+old->de entry directly, because the old->de could have moved from under
+us during make indexed dir. So find the old entry again before reset is
+needed, otherwise it may corrupt the filesystem as below.
+
+ /dev/sda: Entry '00000001' in ??? (12) has deleted/unused inode 15. CLEARED.
+ /dev/sda: Unattached inode 75
+ /dev/sda: UNEXPECTED INCONSISTENCY; RUN fsck MANUALLY.
+
+Fixes: 6b4b8e6b4ad ("ext4: fix bug for rename with RENAME_WHITEOUT")
+Cc: stable@vger.kernel.org
+Signed-off-by: zhangyi (F) <yi.zhang@huawei.com>
+Link: https://lore.kernel.org/r/20210303131703.330415-1-yi.zhang@huawei.com
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/ext4/namei.c | 29 +++++++++++++++++++++++++++--
+ 1 file changed, 27 insertions(+), 2 deletions(-)
+
+--- a/fs/ext4/namei.c
++++ b/fs/ext4/namei.c
+@@ -3601,6 +3601,31 @@ static int ext4_setent(handle_t *handle,
+ return retval;
+ }
+
++static void ext4_resetent(handle_t *handle, struct ext4_renament *ent,
++ unsigned ino, unsigned file_type)
++{
++ struct ext4_renament old = *ent;
++ int retval = 0;
++
++ /*
++ * old->de could have moved from under us during make indexed dir,
++ * so the old->de may no longer valid and need to find it again
++ * before reset old inode info.
++ */
++ old.bh = ext4_find_entry(old.dir, &old.dentry->d_name, &old.de, NULL);
++ if (IS_ERR(old.bh))
++ retval = PTR_ERR(old.bh);
++ if (!old.bh)
++ retval = -ENOENT;
++ if (retval) {
++ ext4_std_error(old.dir->i_sb, retval);
++ return;
++ }
++
++ ext4_setent(handle, &old, ino, file_type);
++ brelse(old.bh);
++}
++
+ static int ext4_find_delete_entry(handle_t *handle, struct inode *dir,
+ const struct qstr *d_name)
+ {
+@@ -3923,8 +3948,8 @@ static int ext4_rename(struct inode *old
+ end_rename:
+ if (whiteout) {
+ if (retval) {
+- ext4_setent(handle, &old,
+- old.inode->i_ino, old_file_type);
++ ext4_resetent(handle, &old,
++ old.inode->i_ino, old_file_type);
+ drop_nlink(whiteout);
+ }
+ unlock_new_inode(whiteout);
--- /dev/null
+From f053cf7aa66cd9d592b0fc967f4d887c2abff1b7 Mon Sep 17 00:00:00 2001
+From: Eric Biggers <ebiggers@google.com>
+Date: Tue, 2 Mar 2021 12:04:19 -0800
+Subject: ext4: fix error handling in ext4_end_enable_verity()
+
+From: Eric Biggers <ebiggers@google.com>
+
+commit f053cf7aa66cd9d592b0fc967f4d887c2abff1b7 upstream.
+
+ext4 didn't properly clean up if verity failed to be enabled on a file:
+
+- It left verity metadata (pages past EOF) in the page cache, which
+ would be exposed to userspace if the file was later extended.
+
+- It didn't truncate the verity metadata at all (either from cache or
+ from disk) if an error occurred while setting the verity bit.
+
+Fix these bugs by adding a call to truncate_inode_pages() and ensuring
+that we truncate the verity metadata (both from cache and from disk) in
+all error paths. Also rework the code to cleanly separate the success
+path from the error paths, which makes it much easier to understand.
+
+Reported-by: Yunlei He <heyunlei@hihonor.com>
+Fixes: c93d8f885809 ("ext4: add basic fs-verity support")
+Cc: stable@vger.kernel.org # v5.4+
+Signed-off-by: Eric Biggers <ebiggers@google.com>
+Link: https://lore.kernel.org/r/20210302200420.137977-2-ebiggers@kernel.org
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/ext4/verity.c | 93 +++++++++++++++++++++++++++++++++----------------------
+ 1 file changed, 57 insertions(+), 36 deletions(-)
+
+--- a/fs/ext4/verity.c
++++ b/fs/ext4/verity.c
+@@ -201,55 +201,76 @@ static int ext4_end_enable_verity(struct
+ struct inode *inode = file_inode(filp);
+ const int credits = 2; /* superblock and inode for ext4_orphan_del() */
+ handle_t *handle;
++ struct ext4_iloc iloc;
+ int err = 0;
+- int err2;
+
+- if (desc != NULL) {
+- /* Succeeded; write the verity descriptor. */
+- err = ext4_write_verity_descriptor(inode, desc, desc_size,
+- merkle_tree_size);
+-
+- /* Write all pages before clearing VERITY_IN_PROGRESS. */
+- if (!err)
+- err = filemap_write_and_wait(inode->i_mapping);
+- }
++ /*
++ * If an error already occurred (which fs/verity/ signals by passing
++ * desc == NULL), then only clean-up is needed.
++ */
++ if (desc == NULL)
++ goto cleanup;
+
+- /* If we failed, truncate anything we wrote past i_size. */
+- if (desc == NULL || err)
+- ext4_truncate(inode);
++ /* Append the verity descriptor. */
++ err = ext4_write_verity_descriptor(inode, desc, desc_size,
++ merkle_tree_size);
++ if (err)
++ goto cleanup;
+
+ /*
+- * We must always clean up by clearing EXT4_STATE_VERITY_IN_PROGRESS and
+- * deleting the inode from the orphan list, even if something failed.
+- * If everything succeeded, we'll also set the verity bit in the same
+- * transaction.
++ * Write all pages (both data and verity metadata). Note that this must
++ * happen before clearing EXT4_STATE_VERITY_IN_PROGRESS; otherwise pages
++ * beyond i_size won't be written properly. For crash consistency, this
++ * also must happen before the verity inode flag gets persisted.
+ */
++ err = filemap_write_and_wait(inode->i_mapping);
++ if (err)
++ goto cleanup;
+
+- ext4_clear_inode_state(inode, EXT4_STATE_VERITY_IN_PROGRESS);
++ /*
++ * Finally, set the verity inode flag and remove the inode from the
++ * orphan list (in a single transaction).
++ */
+
+ handle = ext4_journal_start(inode, EXT4_HT_INODE, credits);
+ if (IS_ERR(handle)) {
+- ext4_orphan_del(NULL, inode);
+- return PTR_ERR(handle);
++ err = PTR_ERR(handle);
++ goto cleanup;
+ }
+
+- err2 = ext4_orphan_del(handle, inode);
+- if (err2)
+- goto out_stop;
+-
+- if (desc != NULL && !err) {
+- struct ext4_iloc iloc;
+-
+- err = ext4_reserve_inode_write(handle, inode, &iloc);
+- if (err)
+- goto out_stop;
+- ext4_set_inode_flag(inode, EXT4_INODE_VERITY);
+- ext4_set_inode_flags(inode, false);
+- err = ext4_mark_iloc_dirty(handle, inode, &iloc);
+- }
+-out_stop:
++ err = ext4_orphan_del(handle, inode);
++ if (err)
++ goto stop_and_cleanup;
++
++ err = ext4_reserve_inode_write(handle, inode, &iloc);
++ if (err)
++ goto stop_and_cleanup;
++
++ ext4_set_inode_flag(inode, EXT4_INODE_VERITY);
++ ext4_set_inode_flags(inode, false);
++ err = ext4_mark_iloc_dirty(handle, inode, &iloc);
++ if (err)
++ goto stop_and_cleanup;
++
+ ext4_journal_stop(handle);
+- return err ?: err2;
++
++ ext4_clear_inode_state(inode, EXT4_STATE_VERITY_IN_PROGRESS);
++ return 0;
++
++stop_and_cleanup:
++ ext4_journal_stop(handle);
++cleanup:
++ /*
++ * Verity failed to be enabled, so clean up by truncating any verity
++ * metadata that was written beyond i_size (both from cache and from
++ * disk), removing the inode from the orphan list (if it wasn't done
++ * already), and clearing EXT4_STATE_VERITY_IN_PROGRESS.
++ */
++ truncate_inode_pages(inode->i_mapping, inode->i_size);
++ ext4_truncate(inode);
++ ext4_orphan_del(NULL, inode);
++ ext4_clear_inode_state(inode, EXT4_STATE_VERITY_IN_PROGRESS);
++ return err;
+ }
+
+ static int ext4_get_verity_descriptor_location(struct inode *inode,
--- /dev/null
+From 7d8bd3c76da1d94b85e6c9b7007e20e980bfcfe6 Mon Sep 17 00:00:00 2001
+From: Shijie Luo <luoshijie1@huawei.com>
+Date: Fri, 12 Mar 2021 01:50:51 -0500
+Subject: ext4: fix potential error in ext4_do_update_inode
+
+From: Shijie Luo <luoshijie1@huawei.com>
+
+commit 7d8bd3c76da1d94b85e6c9b7007e20e980bfcfe6 upstream.
+
+If set_large_file = 1 and errors occur in ext4_handle_dirty_metadata(),
+the error code will be overridden, go to out_brelse to avoid this
+situation.
+
+Signed-off-by: Shijie Luo <luoshijie1@huawei.com>
+Link: https://lore.kernel.org/r/20210312065051.36314-1-luoshijie1@huawei.com
+Cc: stable@kernel.org
+Reviewed-by: Jan Kara <jack@suse.cz>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/ext4/inode.c | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+--- a/fs/ext4/inode.c
++++ b/fs/ext4/inode.c
+@@ -5029,7 +5029,7 @@ static int ext4_do_update_inode(handle_t
+ struct ext4_inode_info *ei = EXT4_I(inode);
+ struct buffer_head *bh = iloc->bh;
+ struct super_block *sb = inode->i_sb;
+- int err = 0, rc, block;
++ int err = 0, block;
+ int need_datasync = 0, set_large_file = 0;
+ uid_t i_uid;
+ gid_t i_gid;
+@@ -5141,9 +5141,9 @@ static int ext4_do_update_inode(handle_t
+ bh->b_data);
+
+ BUFFER_TRACE(bh, "call ext4_handle_dirty_metadata");
+- rc = ext4_handle_dirty_metadata(handle, NULL, bh);
+- if (!err)
+- err = rc;
++ err = ext4_handle_dirty_metadata(handle, NULL, bh);
++ if (err)
++ goto out_brelse;
+ ext4_clear_inode_state(inode, EXT4_STATE_NEW);
+ if (set_large_file) {
+ BUFFER_TRACE(EXT4_SB(sb)->s_sbh, "get write access");
--- /dev/null
+From 8210bb29c1b66200cff7b25febcf6e39baf49fbf Mon Sep 17 00:00:00 2001
+From: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
+Date: Tue, 16 Mar 2021 15:19:21 -0700
+Subject: ext4: fix rename whiteout with fast commit
+
+From: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
+
+commit 8210bb29c1b66200cff7b25febcf6e39baf49fbf upstream.
+
+This patch adds rename whiteout support in fast commits. Note that the
+whiteout object that gets created is actually char device. Which
+imples, the function ext4_inode_journal_mode(struct inode *inode)
+would return "JOURNAL_DATA" for this inode. This has a consequence in
+fast commit code that it will make creation of the whiteout object a
+fast-commit ineligible behavior and thus will fall back to full
+commits. With this patch, this can be observed by running fast commits
+with rename whiteout and seeing the stats generated by ext4_fc_stats
+tracepoint as follows:
+
+ext4_fc_stats: dev 254:32 fc ineligible reasons:
+XATTR:0, CROSS_RENAME:0, JOURNAL_FLAG_CHANGE:0, NO_MEM:0, SWAP_BOOT:0,
+RESIZE:0, RENAME_DIR:0, FALLOC_RANGE:0, INODE_JOURNAL_DATA:16;
+num_commits:6, ineligible: 6, numblks: 3
+
+So in short, this patch guarantees that in case of rename whiteout, we
+fall back to full commits.
+
+Amir mentioned that instead of creating a new whiteout object for
+every rename, we can create a static whiteout object with irrelevant
+nlink. That will make fast commits to not fall back to full
+commit. But until this happens, this patch will ensure correctness by
+falling back to full commits.
+
+Fixes: 8016e29f4362 ("ext4: fast commit recovery path")
+Cc: stable@kernel.org
+Signed-off-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
+Link: https://lore.kernel.org/r/20210316221921.1124955-1-harshadshirwadkar@gmail.com
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/ext4/ext4.h | 2 ++
+ fs/ext4/fast_commit.c | 9 +++++++--
+ fs/ext4/namei.c | 3 +++
+ 3 files changed, 12 insertions(+), 2 deletions(-)
+
+--- a/fs/ext4/ext4.h
++++ b/fs/ext4/ext4.h
+@@ -2792,6 +2792,8 @@ void __ext4_fc_track_link(handle_t *hand
+ struct dentry *dentry);
+ void ext4_fc_track_unlink(handle_t *handle, struct dentry *dentry);
+ void ext4_fc_track_link(handle_t *handle, struct dentry *dentry);
++void __ext4_fc_track_create(handle_t *handle, struct inode *inode,
++ struct dentry *dentry);
+ void ext4_fc_track_create(handle_t *handle, struct dentry *dentry);
+ void ext4_fc_track_inode(handle_t *handle, struct inode *inode);
+ void ext4_fc_mark_ineligible(struct super_block *sb, int reason);
+--- a/fs/ext4/fast_commit.c
++++ b/fs/ext4/fast_commit.c
+@@ -513,10 +513,10 @@ void ext4_fc_track_link(handle_t *handle
+ __ext4_fc_track_link(handle, d_inode(dentry), dentry);
+ }
+
+-void ext4_fc_track_create(handle_t *handle, struct dentry *dentry)
++void __ext4_fc_track_create(handle_t *handle, struct inode *inode,
++ struct dentry *dentry)
+ {
+ struct __track_dentry_update_args args;
+- struct inode *inode = d_inode(dentry);
+ int ret;
+
+ args.dentry = dentry;
+@@ -527,6 +527,11 @@ void ext4_fc_track_create(handle_t *hand
+ trace_ext4_fc_track_create(inode, dentry, ret);
+ }
+
++void ext4_fc_track_create(handle_t *handle, struct dentry *dentry)
++{
++ __ext4_fc_track_create(handle, d_inode(dentry), dentry);
++}
++
+ /* __track_fn for inode tracking */
+ static int __track_inode(struct inode *inode, void *arg, bool update)
+ {
+--- a/fs/ext4/namei.c
++++ b/fs/ext4/namei.c
+@@ -3861,6 +3861,7 @@ static int ext4_rename(struct inode *old
+ retval = ext4_mark_inode_dirty(handle, whiteout);
+ if (unlikely(retval))
+ goto end_rename;
++
+ }
+ if (!new.bh) {
+ retval = ext4_add_entry(handle, new.dentry, old.inode);
+@@ -3934,6 +3935,8 @@ static int ext4_rename(struct inode *old
+ ext4_fc_track_unlink(handle, new.dentry);
+ __ext4_fc_track_link(handle, old.inode, new.dentry);
+ __ext4_fc_track_unlink(handle, old.inode, old.dentry);
++ if (whiteout)
++ __ext4_fc_track_create(handle, whiteout, old.dentry);
+ }
+
+ if (new.inode) {
--- /dev/null
+From 2a4ae3bcdf05b8639406eaa09a2939f3c6dd8e75 Mon Sep 17 00:00:00 2001
+From: Jan Kara <jack@suse.cz>
+Date: Mon, 15 Mar 2021 17:59:06 +0100
+Subject: ext4: fix timer use-after-free on failed mount
+
+From: Jan Kara <jack@suse.cz>
+
+commit 2a4ae3bcdf05b8639406eaa09a2939f3c6dd8e75 upstream.
+
+When filesystem mount fails because of corrupted filesystem we first
+cancel the s_err_report timer reminding fs errors every day and only
+then we flush s_error_work. However s_error_work may report another fs
+error and re-arm timer thus resulting in timer use-after-free. Fix the
+problem by first flushing the work and only after that canceling the
+s_err_report timer.
+
+Reported-by: syzbot+628472a2aac693ab0fcd@syzkaller.appspotmail.com
+Fixes: 2d01ddc86606 ("ext4: save error info to sb through journal if available")
+CC: stable@vger.kernel.org
+Signed-off-by: Jan Kara <jack@suse.cz>
+Link: https://lore.kernel.org/r/20210315165906.2175-1-jack@suse.cz
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/ext4/super.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/fs/ext4/super.c
++++ b/fs/ext4/super.c
+@@ -5149,8 +5149,8 @@ failed_mount_wq:
+ failed_mount3a:
+ ext4_es_unregister_shrinker(sbi);
+ failed_mount3:
+- del_timer_sync(&sbi->s_err_report);
+ flush_work(&sbi->s_error_work);
++ del_timer_sync(&sbi->s_err_report);
+ if (sbi->s_mmp_tsk)
+ kthread_stop(sbi->s_mmp_tsk);
+ failed_mount2:
--- /dev/null
+From 512c15ef05d73a04f1aef18a3bc61a8bb516f323 Mon Sep 17 00:00:00 2001
+From: Pan Bian <bianpan2016@163.com>
+Date: Sun, 17 Jan 2021 00:57:32 -0800
+Subject: ext4: stop inode update before return
+
+From: Pan Bian <bianpan2016@163.com>
+
+commit 512c15ef05d73a04f1aef18a3bc61a8bb516f323 upstream.
+
+The inode update should be stopped before returing the error code.
+
+Signed-off-by: Pan Bian <bianpan2016@163.com>
+Link: https://lore.kernel.org/r/20210117085732.93788-1-bianpan2016@163.com
+Fixes: 8016e29f4362 ("ext4: fast commit recovery path")
+Cc: stable@kernel.org
+Reviewed-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
+Signed-off-by: Theodore Ts'o <tytso@mit.edu>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ fs/ext4/inode.c | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/fs/ext4/inode.c
++++ b/fs/ext4/inode.c
+@@ -5389,8 +5389,10 @@ int ext4_setattr(struct dentry *dentry,
+ inode->i_gid = attr->ia_gid;
+ error = ext4_mark_inode_dirty(handle, inode);
+ ext4_journal_stop(handle);
+- if (unlikely(error))
++ if (unlikely(error)) {
++ ext4_fc_stop_update(inode);
+ return error;
++ }
+ }
+
+ if (attr->ia_valid & ATTR_SIZE) {
--- /dev/null
+From f8d70fd6a5a7a38a95eb8021e00d2e547f88efec Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Sat, 13 Mar 2021 14:58:02 +0100
+Subject: MAINTAINERS: move some real subsystems off of the staging mailing list
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit f8d70fd6a5a7a38a95eb8021e00d2e547f88efec upstream.
+
+The VME and Android drivers still have their MAINTAINERS entries
+pointing to the "driverdevel" mailing list, due to them having their
+codebase move out of the drivers/staging/ directory, but no one
+remembered to change the mailing list entries.
+
+Move them both to linux-kernel for lack of a more specific place at the
+moment. These are both low-volume areas of the kernel, so this
+shouldn't be an issue.
+
+Cc: Martyn Welch <martyn@welchs.me.uk>
+Cc: Manohar Vanga <manohar.vanga@gmail.com>
+Cc: Arve Hjønnevåg <arve@android.com>
+Cc: Todd Kjos <tkjos@android.com>
+Cc: Martijn Coenen <maco@android.com>
+Cc: Joel Fernandes <joel@joelfernandes.org>
+Cc: Christian Brauner <christian@brauner.io>
+Cc: Hridya Valsaraju <hridya@google.com>
+Cc: Suren Baghdasaryan <surenb@google.com>
+Reported-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
+Link: https://lore.kernel.org/r/YEzE6u6U1jkBatmr@kroah.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ MAINTAINERS | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -1169,7 +1169,7 @@ M: Joel Fernandes <joel@joelfernandes.or
+ M: Christian Brauner <christian@brauner.io>
+ M: Hridya Valsaraju <hridya@google.com>
+ M: Suren Baghdasaryan <surenb@google.com>
+-L: devel@driverdev.osuosl.org
++L: linux-kernel@vger.kernel.org
+ S: Supported
+ T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
+ F: drivers/android/
+@@ -18993,7 +18993,7 @@ VME SUBSYSTEM
+ M: Martyn Welch <martyn@welchs.me.uk>
+ M: Manohar Vanga <manohar.vanga@gmail.com>
+ M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+-L: devel@driverdev.osuosl.org
++L: linux-kernel@vger.kernel.org
+ S: Maintained
+ T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
+ F: Documentation/driver-api/vme.rst
--- /dev/null
+From e06da9ea3e3f6746a849edeae1d09ee821f5c2ce Mon Sep 17 00:00:00 2001
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+Date: Tue, 16 Mar 2021 11:23:11 +0100
+Subject: MAINTAINERS: move the staging subsystem to lists.linux.dev
+
+From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+commit e06da9ea3e3f6746a849edeae1d09ee821f5c2ce upstream.
+
+The drivers/staging/ tree has a new mailing list,
+linux-staging@lists.linux.dev, so move the MAINTAINER entry to point to
+it so that we get patches sent to the proper place.
+
+There was no need to specify a list for the hikey9xx driver, the tools
+pick up the "base" list for drivers/staging/* so remove that line to
+make the file simpler.
+
+Cc: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+Link: https://lore.kernel.org/r/20210316102311.182375-1-gregkh@linuxfoundation.org
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ MAINTAINERS | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/MAINTAINERS
++++ b/MAINTAINERS
+@@ -8079,7 +8079,6 @@ F: drivers/crypto/hisilicon/sec2/sec_mai
+
+ HISILICON STAGING DRIVERS FOR HIKEY 960/970
+ M: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
+-L: devel@driverdev.osuosl.org
+ S: Maintained
+ F: drivers/staging/hikey9xx/
+
+@@ -16911,7 +16910,7 @@ F: drivers/staging/vt665?/
+
+ STAGING SUBSYSTEM
+ M: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+-L: devel@driverdev.osuosl.org
++L: linux-staging@lists.linux.dev
+ S: Supported
+ T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git
+ F: drivers/staging/
kernel-fs-introduce-and-use-set_restart_fn-and-arch_set_restart_data.patch
x86-move-ts_compat-back-to-asm-thread_info.h.patch
x86-introduce-ts_compat_restart-to-fix-get_nr_restart_syscall.patch
+efivars-respect-efi_unsupported-return-from-firmware.patch
+ext4-fix-error-handling-in-ext4_end_enable_verity.patch
+ext4-find-old-entry-again-if-failed-to-rename-whiteout.patch
+ext4-stop-inode-update-before-return.patch
+ext4-do-not-try-to-set-xattr-into-ea_inode-if-value-is-empty.patch
+ext4-fix-potential-error-in-ext4_do_update_inode.patch
+ext4-fix-timer-use-after-free-on-failed-mount.patch
+ext4-fix-rename-whiteout-with-fast-commit.patch
+maintainers-move-some-real-subsystems-off-of-the-staging-mailing-list.patch
+maintainers-move-the-staging-subsystem-to-lists.linux.dev.patch