[PATCH] hfsplus: hfsplus_file_fsync() does not check for return value of sync_inode_metadata()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxx>
---
 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

--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux