From: Changwoo Min <changwoo.m@gmail.com>
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 <changwoo.m@gmail.com>
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 [thread overview]
Message-ID: <1427124798-17530-1-git-send-email-changwoo.m@gmail.com> (raw)
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 <changwoo.m@gmail.com>
---
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
next reply other threads:[~2015-03-23 15:33 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-23 15:33 Changwoo Min [this message]
2015-03-23 17:16 ` Viacheslav Dubeyko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1427124798-17530-1-git-send-email-changwoo.m@gmail.com \
--to=changwoo.m@gmail.com \
--cc=blee@gatech.edu \
--cc=changwoo@gatech.edu \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sanidhya@gatech.edu \
--cc=taesoo@gatech.edu \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®