From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752812AbbCWPdW (ORCPT ); Mon, 23 Mar 2015 11:33:22 -0400 Received: from mail-yk0-f193.google.com ([209.85.160.193]:34356 "EHLO mail-yk0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752218AbbCWPdU (ORCPT ); Mon, 23 Mar 2015 11:33:20 -0400 From: Changwoo Min To: viro@zeniv.linux.org.uk, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: taesoo@gatech.edu, changwoo@gatech.edu, sanidhya@gatech.edu, blee@gatech.edu, Changwoo Min Subject: [PATCH] hfsplus: hfsplus_file_fsync() does not check for return value of sync_inode_metadata() Date: Mon, 23 Mar 2015 11:33:18 -0400 Message-Id: <1427124798-17530-1-git-send-email-changwoo.m@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hfsplus_file_fsync() siliently ignores the return value of sync_inode_metadata(). If an error occurs at sync_inode_metadata() and subsequent updates of other file system metadata (b-trees) succeed, file system metadata will be inconsistent. Signed-off-by: Changwoo Min --- fs/hfsplus/inode.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fs/hfsplus/inode.c b/fs/hfsplus/inode.c index 0cf786f..9444719 100644 --- a/fs/hfsplus/inode.c +++ b/fs/hfsplus/inode.c @@ -286,7 +286,11 @@ int hfsplus_file_fsync(struct file *file, loff_t start, loff_t end, /* * Sync inode metadata into the catalog and extent trees. */ - sync_inode_metadata(inode, 1); + error = sync_inode_metadata(inode, 1); + if (error) { + mutex_unlock(&inode->i_mutex); + return error; + } /* * And explicitly write out the btrees. -- 1.9.1