From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755022AbcHVU3L (ORCPT ); Mon, 22 Aug 2016 16:29:11 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36562 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753060AbcHVU3I (ORCPT ); Mon, 22 Aug 2016 16:29:08 -0400 From: Quorum Laval To: shaggy@kernel.org Cc: Quorum Laval , jfs-discussion@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH 2/2] jfs: jump to error_out when filemap_write_and_wait fails Date: Mon, 22 Aug 2016 21:29:00 +0100 Message-Id: X-Mailer: git-send-email 1.9.1 In-Reply-To: <997dc120ca508e8a2e757f201cca29f4dbee395d.1471896658.git.quorum.laval@gmail.com> References: <997dc120ca508e8a2e757f201cca29f4dbee395d.1471896658.git.quorum.laval@gmail.com> In-Reply-To: <997dc120ca508e8a2e757f201cca29f4dbee395d.1471896658.git.quorum.laval@gmail.com> References: <997dc120ca508e8a2e757f201cca29f4dbee395d.1471896658.git.quorum.laval@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org filemap_write_and_wait may fails, so check the return value and jump to error_out in the case of error. Signed-off-by: Quorum Laval --- fs/jfs/resize.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/jfs/resize.c b/fs/jfs/resize.c index b0322da..bd9b641 100644 --- a/fs/jfs/resize.c +++ b/fs/jfs/resize.c @@ -383,7 +383,10 @@ int jfs_extendfs(struct super_block *sb, s64 newLVSize, int newLogSize) if (rc) goto error_out; - filemap_write_and_wait(ipbmap->i_mapping); + rc = filemap_write_and_wait(ipbmap->i_mapping); + if (rc) + goto error_out; + diWriteSpecial(ipbmap, 0); newPage = nPages; /* first new page number */ -- 1.9.1