ext4 crypto: fix some error handling
authorDan Carpenter <dan.carpenter@oracle.com>
Sat, 2 Apr 2016 22:13:38 +0000 (18:13 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 May 2017 12:30:11 +0000 (14:30 +0200)
commit 4762cc3fbbd89e5fd316d6e4d3244a8984444f8d upstream.

We should be testing for -ENOMEM but the minus sign is missing.

Fixes: c9af28fdd449 ('ext4 crypto: don't let data integrity writebacks fail with ENOMEM')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/page-io.c

index 5c72ae5d62a62f4016d994d9c101db91f9a00a98..6ca56f5f72b509caf1149ce1a6768b7aed6b490a 100644 (file)
@@ -492,7 +492,7 @@ int ext4_bio_write_page(struct ext4_io_submit *io,
                data_page = ext4_encrypt(inode, page, gfp_flags);
                if (IS_ERR(data_page)) {
                        ret = PTR_ERR(data_page);
-                       if (ret == ENOMEM && wbc->sync_mode == WB_SYNC_ALL) {
+                       if (ret == -ENOMEM && wbc->sync_mode == WB_SYNC_ALL) {
                                if (io->io_bio) {
                                        ext4_io_submit(io);
                                        congestion_wait(BLK_RW_ASYNC, HZ/50);