lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Date:   Wed, 18 May 2022 22:57:59 +0800
From:   ChenXiaoSong <chenxiaosong2@...wei.com>
To:     <hubcap@...ibond.com>
CC:     <devel@...ts.orangefs.org>, <linux-kernel@...r.kernel.org>,
        <chenxiaosong2@...wei.com>, <liuyongqiang13@...wei.com>,
        <yi.zhang@...wei.com>, <zhangxiaoxu5@...wei.com>
Subject: [PATCH -next] orangefs: return the more nuanced writeback error on close()

As filemap_check_errors() only report -EIO or -ENOSPC, we return more nuanced
writeback error -(file->f_mapping->wb_err & MAX_ERRNO).

  filemap_write_and_wait
    filemap_write_and_wait_range
      filemap_check_errors
        -ENOSPC or -EIO
  filemap_check_wb_err
    errseq_check
      return -(file->f_mapping->wb_err & MAX_ERRNO)

Signed-off-by: ChenXiaoSong <chenxiaosong2@...wei.com>
---
 fs/orangefs/file.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/orangefs/file.c b/fs/orangefs/file.c
index 86810e5d7914..5c9f0ad7e317 100644
--- a/fs/orangefs/file.c
+++ b/fs/orangefs/file.c
@@ -545,10 +545,10 @@ static int orangefs_flush(struct file *file, fl_owner_t id)
 	int r;
 
 	r = filemap_write_and_wait_range(file->f_mapping, 0, LLONG_MAX);
-	if (r > 0)
-		return 0;
-	else
-		return r;
+	/* get more nuanced writeback errors */
+	if (r)
+		r = filemap_check_wb_err(file->f_mapping, 0);
+	return r;
 }
 
 /** ORANGEFS implementation of VFS file operations */
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ