[RHEL7,COMMIT] ms/fs: use mapping_set_error instead of opencoded set_bit

Submitted by Konstantin Khorenko on June 18, 2018, 9:07 a.m.

Details

Message ID 201806180907.w5I97giZ019904@finist_ce7.work
State New
Series "ms/fs: use mapping_set_error instead of opencoded set_bit"
Headers show

Commit Message

Konstantin Khorenko June 18, 2018, 9:07 a.m.
The commit is pushed to "branch-rh7-3.10.0-862.3.2.vz7.61.x-ovz" and will appear at https://src.openvz.org/scm/ovz/vzkernel.git
after rh7-3.10.0-862.3.2.vz7.61.3
------>
commit 4c5a0e61862873509866d793f4d427ffb2f30e49
Author: Vasily Averin <vvs@virtuozzo.com>
Date:   Mon Jun 18 12:07:42 2018 +0300

    ms/fs: use mapping_set_error instead of opencoded set_bit
    
    backported ext4_finish_bio hunk from mainline
      commit 5114a97a8bce7f4ead29a32b67dee85438699b9e
      Author: Michal Hocko <mhocko@suse.com>
      Date:   Tue Oct 11 13:56:01 2016 -0700
    
        fs: use mapping_set_error instead of opencoded set_bit
    
        The mapping_set_error() helper sets the correct AS_ flag for the mapping
        so there is no reason to open code it.  Use the helper directly.
    
        [akpm@linux-foundation.org: be honest about conversion from -ENXIO to -EIO]
        Link: http://lkml.kernel.org/r/20160912111608.2588-2-mhocko@kernel.org
        Signed-off-by: Michal Hocko <mhocko@suse.com>
        Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
        Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
    
    https://pmc.acronis.com/browse/VSTOR-10912
    Signed-off-by: Vasily Averin <vvs@virtuozzo.com>
---
 fs/ext4/page-io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c
index a2e36861292d..174e76e2249f 100644
--- a/fs/ext4/page-io.c
+++ b/fs/ext4/page-io.c
@@ -80,7 +80,7 @@  static void ext4_finish_bio(struct bio *bio)
 
 		if (error) {
 			SetPageError(page);
-			set_bit(AS_EIO, &page->mapping->flags);
+			mapping_set_error(page->mapping, -EIO);
 		}
 		bh = head = page_buffers(page);
 		/*