From patchwork Mon Mar 23 15:33:18 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Changwoo Min X-Patchwork-Id: 6073901 Return-Path: X-Original-To: patchwork-linux-fsdevel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D164B9F399 for ; Mon, 23 Mar 2015 15:33:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1336C201FA for ; Mon, 23 Mar 2015 15:33:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 37C3F201C8 for ; Mon, 23 Mar 2015 15:33:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752406AbbCWPdV (ORCPT ); Mon, 23 Mar 2015 11:33:21 -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 Received: by ykr200 with SMTP id 200so4703391ykr.1; Mon, 23 Mar 2015 08:33:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=VW6Xl4IGqOfYaLArcyGw+kIUNgHnpyIXYQKqR9mlqj8=; b=aB46QO20/766/BDCcENfKw6ap65I83crJFtBuo0VNGbswnVPTYkOOIInGgc7DX2AU9 SFmQFioouxFlqnDYLI9doHQ8DM09iTFwuAdElqyTDUhRW2p3q6XDtgvEXgij0hKkdaEC quztNdHuSspkn8iKCVgtbYxZTSzEzbeINIl1jsJMw++Xs4TuuCarilQdw0bqwilAeZ2L +koE32CdwpWfvT4Sjant/nnlLus/fl+DBN2CY4drWwplW4Q6K4ShV1eqnPElr4ncFU5C OSEksIUaUApcfPMCjiFZQZeGTSY0BPVJcmmnEgjTu6ga0vF0Jxr9/dQr84j8NtFiTzS/ jssw== X-Received: by 10.236.47.131 with SMTP id t3mr7841930yhb.16.1427124800122; Mon, 23 Mar 2015 08:33:20 -0700 (PDT) Received: from changwoo.gtisc.gatech.edu (changwoo.gtisc.gatech.edu. [143.215.130.55]) by mx.google.com with ESMTPSA id g55sm841555yhb.37.2015.03.23.08.33.18 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Mar 2015 08:33:19 -0700 (PDT) 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-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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.