mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] ovl: don't set the superblock's errseq_t manually
@ 2024-07-29  3:43 Haifeng Xu
  2024-07-29  6:43 ` Amir Goldstein
  0 siblings, 1 reply; 4+ messages in thread
From: Haifeng Xu @ 2024-07-29  3:43 UTC (permalink / raw)
  To: miklos, amir73il; +Cc: linux-unionfs, linux-kernel, Haifeng Xu

Since commit 5679897eb104 ("vfs: make sync_filesystem return errors from
->sync_fs"), the return value from sync_fs callback can be seen in
sync_filesystem(). Thus the errseq_set opreation can be removed here.

Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
---
 fs/overlayfs/super.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 06a231970cb5..fe511192f83c 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -202,15 +202,9 @@ static int ovl_sync_fs(struct super_block *sb, int wait)
 	int ret;
 
 	ret = ovl_sync_status(ofs);
-	/*
-	 * We have to always set the err, because the return value isn't
-	 * checked in syncfs, and instead indirectly return an error via
-	 * the sb's writeback errseq, which VFS inspects after this call.
-	 */
-	if (ret < 0) {
-		errseq_set(&sb->s_wb_err, -EIO);
+
+	if (ret < 0)
 		return -EIO;
-	}
 
 	if (!ret)
 		return ret;
-- 
2.25.1


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

* Re: [PATCH] ovl: don't set the superblock's errseq_t manually
  2024-07-29  3:43 [PATCH] ovl: don't set the superblock's errseq_t manually Haifeng Xu
@ 2024-07-29  6:43 ` Amir Goldstein
  2024-07-29  9:22   ` Haifeng Xu
  2024-07-30  4:20   ` [PATCH v2] " Haifeng Xu
  0 siblings, 2 replies; 4+ messages in thread
From: Amir Goldstein @ 2024-07-29  6:43 UTC (permalink / raw)
  To: Haifeng Xu; +Cc: miklos, linux-unionfs, linux-kernel

On Mon, Jul 29, 2024 at 6:43 AM Haifeng Xu <haifeng.xu@shopee.com> wrote:
>
> Since commit 5679897eb104 ("vfs: make sync_filesystem return errors from
> ->sync_fs"), the return value from sync_fs callback can be seen in
> sync_filesystem(). Thus the errseq_set opreation can be removed here.
>
> Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>

I would add either Fixes: or Depends-on: to prevent accidental
backporting without the dependency.

Otherwise you may add:
Reviewed-by: Amir Goldstein <amir73il@gmail.com>

Thanks,
Amir.

> ---
>  fs/overlayfs/super.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
> index 06a231970cb5..fe511192f83c 100644
> --- a/fs/overlayfs/super.c
> +++ b/fs/overlayfs/super.c
> @@ -202,15 +202,9 @@ static int ovl_sync_fs(struct super_block *sb, int wait)
>         int ret;
>
>         ret = ovl_sync_status(ofs);
> -       /*
> -        * We have to always set the err, because the return value isn't
> -        * checked in syncfs, and instead indirectly return an error via
> -        * the sb's writeback errseq, which VFS inspects after this call.
> -        */
> -       if (ret < 0) {
> -               errseq_set(&sb->s_wb_err, -EIO);
> +
> +       if (ret < 0)
>                 return -EIO;
> -       }
>
>         if (!ret)
>                 return ret;
> --
> 2.25.1
>

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

* Re: [PATCH] ovl: don't set the superblock's errseq_t manually
  2024-07-29  6:43 ` Amir Goldstein
@ 2024-07-29  9:22   ` Haifeng Xu
  2024-07-30  4:20   ` [PATCH v2] " Haifeng Xu
  1 sibling, 0 replies; 4+ messages in thread
From: Haifeng Xu @ 2024-07-29  9:22 UTC (permalink / raw)
  To: Amir Goldstein; +Cc: miklos, linux-unionfs, linux-kernel



On 2024/7/29 14:43, Amir Goldstein wrote:
> On Mon, Jul 29, 2024 at 6:43 AM Haifeng Xu <haifeng.xu@shopee.com> wrote:
>>
>> Since commit 5679897eb104 ("vfs: make sync_filesystem return errors from
>> ->sync_fs"), the return value from sync_fs callback can be seen in
>> sync_filesystem(). Thus the errseq_set opreation can be removed here.
>>
>> Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
> 
> I would add either Fixes: or Depends-on: to prevent accidental
> backporting without the dependency.

OK, I'll add this in next version. Thanks!

> 
> Otherwise you may add:
> Reviewed-by: Amir Goldstein <amir73il@gmail.com>
> 
> Thanks,
> Amir.
> 
>> ---
>>  fs/overlayfs/super.c | 10 ++--------
>>  1 file changed, 2 insertions(+), 8 deletions(-)
>>
>> diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
>> index 06a231970cb5..fe511192f83c 100644
>> --- a/fs/overlayfs/super.c
>> +++ b/fs/overlayfs/super.c
>> @@ -202,15 +202,9 @@ static int ovl_sync_fs(struct super_block *sb, int wait)
>>         int ret;
>>
>>         ret = ovl_sync_status(ofs);
>> -       /*
>> -        * We have to always set the err, because the return value isn't
>> -        * checked in syncfs, and instead indirectly return an error via
>> -        * the sb's writeback errseq, which VFS inspects after this call.
>> -        */
>> -       if (ret < 0) {
>> -               errseq_set(&sb->s_wb_err, -EIO);
>> +
>> +       if (ret < 0)
>>                 return -EIO;
>> -       }
>>
>>         if (!ret)
>>                 return ret;
>> --
>> 2.25.1
>>

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

* [PATCH v2] ovl: don't set the superblock's errseq_t manually
  2024-07-29  6:43 ` Amir Goldstein
  2024-07-29  9:22   ` Haifeng Xu
@ 2024-07-30  4:20   ` Haifeng Xu
  1 sibling, 0 replies; 4+ messages in thread
From: Haifeng Xu @ 2024-07-30  4:20 UTC (permalink / raw)
  To: amir73il; +Cc: miklos, linux-unionfs, linux-kernel, Haifeng Xu

Since commit 5679897eb104 ("vfs: make sync_filesystem return errors from
->sync_fs"), the return value from sync_fs callback can be seen in
sync_filesystem(). Thus the errseq_set opreation can be removed here.

Depends-on: commit 5679897eb104 ("vfs: make sync_filesystem return errors from ->sync_fs")
Signed-off-by: Haifeng Xu <haifeng.xu@shopee.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
---
Changes since v1:
- Add Depends-on and Reviewed-by tags.
---
 fs/overlayfs/super.c | 10 ++--------
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
index 06a231970cb5..fe511192f83c 100644
--- a/fs/overlayfs/super.c
+++ b/fs/overlayfs/super.c
@@ -202,15 +202,9 @@ static int ovl_sync_fs(struct super_block *sb, int wait)
 	int ret;
 
 	ret = ovl_sync_status(ofs);
-	/*
-	 * We have to always set the err, because the return value isn't
-	 * checked in syncfs, and instead indirectly return an error via
-	 * the sb's writeback errseq, which VFS inspects after this call.
-	 */
-	if (ret < 0) {
-		errseq_set(&sb->s_wb_err, -EIO);
+
+	if (ret < 0)
 		return -EIO;
-	}
 
 	if (!ret)
 		return ret;
-- 
2.25.1


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

end of thread, other threads:[~2024-07-30  4:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-29  3:43 [PATCH] ovl: don't set the superblock's errseq_t manually Haifeng Xu
2024-07-29  6:43 ` Amir Goldstein
2024-07-29  9:22   ` Haifeng Xu
2024-07-30  4:20   ` [PATCH v2] " Haifeng Xu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®