linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ext4: stop update inode before return
@ 2021-01-19 11:01 Pan Bian
  2021-01-20 17:43 ` harshad shirwadkar
  0 siblings, 1 reply; 2+ messages in thread
From: Pan Bian @ 2021-01-19 11:01 UTC (permalink / raw)
  To: Theodore Ts'o, Andreas Dilger, Harshad Shirwadkar
  Cc: linux-ext4, linux-kernel, Pan Bian

Stop inode updating before returning the error code.

Fixes: aa75f4d3daae ("ext4: main fast-commit commit path")
Signed-off-by: Pan Bian <bianpan2016@163.com>
---
 fs/ext4/inode.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index c173c8405856..64039bbb656d 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -5389,8 +5389,10 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
 			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) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] ext4: stop update inode before return
  2021-01-19 11:01 [PATCH] ext4: stop update inode before return Pan Bian
@ 2021-01-20 17:43 ` harshad shirwadkar
  0 siblings, 0 replies; 2+ messages in thread
From: harshad shirwadkar @ 2021-01-20 17:43 UTC (permalink / raw)
  To: Pan Bian
  Cc: Theodore Ts'o, Andreas Dilger, Ext4 Developers List, linux-kernel

Thanks Pan for the fix. Looks good to me.

Reviewed-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>

On Tue, Jan 19, 2021 at 3:04 AM Pan Bian <bianpan2016@163.com> wrote:
>
> Stop inode updating before returning the error code.
>
> Fixes: aa75f4d3daae ("ext4: main fast-commit commit path")
> Signed-off-by: Pan Bian <bianpan2016@163.com>
> ---
>  fs/ext4/inode.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index c173c8405856..64039bbb656d 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -5389,8 +5389,10 @@ int ext4_setattr(struct dentry *dentry, struct iattr *attr)
>                         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) {
> --
> 2.17.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-01-20 17:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 11:01 [PATCH] ext4: stop update inode before return Pan Bian
2021-01-20 17:43 ` harshad shirwadkar

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).