From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f194.google.com ([209.85.192.194]:35861 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1763145AbdEVXix (ORCPT ); Mon, 22 May 2017 19:38:53 -0400 Received: by mail-pf0-f194.google.com with SMTP id n23so23144933pfb.3 for ; Mon, 22 May 2017 16:38:53 -0700 (PDT) From: Eric Biggers To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , Dan Carpenter , Theodore Ts'o , Eric Biggers Subject: [PATCH 2/2] ext4 crypto: fix some error handling Date: Mon, 22 May 2017 16:37:52 -0700 Message-Id: <20170522233752.109220-2-ebiggers3@gmail.com> In-Reply-To: <20170522233752.109220-1-ebiggers3@gmail.com> References: <20170522233752.109220-1-ebiggers3@gmail.com> Sender: stable-owner@vger.kernel.org List-ID: From: Dan Carpenter commit 4762cc3fbbd89e5fd316d6e4d3244a8984444f8d upstream. Please apply to 4.4-stable. 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 Signed-off-by: Theodore Ts'o Signed-off-by: Eric Biggers --- fs/ext4/page-io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ext4/page-io.c b/fs/ext4/page-io.c index 5c72ae5d62a6..6ca56f5f72b5 100644 --- a/fs/ext4/page-io.c +++ b/fs/ext4/page-io.c @@ -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); -- 2.13.0.303.g4ebf302169-goog