Skip to contentSkip to conversation

+ hfsplus-fix-concurrent-acess-of-alloc_blocks-fix.patch added to -mm tree

PATCH [email protected] 1 participant 1 message Feb 18, 2014 Hfsplus filesystem

lore
Share & tools
lore
#0 lore raw

Subject: + hfsplus-fix-concurrent-acess-of-alloc_blocks-fix.patch added to -mm tree
To: [email protected],[email protected],[email protected],[email protected],[email protected]
From: [email protected]
Date: Tue, 18 Feb 2014 14:07:38 -0800

The patch titled
Subject: hfsplus-fix-concurrent-acess-of-alloc_blocks-fix
has been added to the -mm tree. Its filename is
hfsplus-fix-concurrent-acess-of-alloc_blocks-fix.patch

This patch should soon appear at
http://ozlabs.org/~akpm/mmots/broken-out/hfsplus-fix-concurrent-acess-of-alloc_blocks-fix.patch
and later at
http://ozlabs.org/~akpm/mmotm/broken-out/hfsplus-fix-concurrent-acess-of-alloc_blocks-fix.patch

Before you just go and hit "reply", please:
a) Consider who else should be cc'ed
b) Prefer to cc a suitable mailing list as well
c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

The -mm tree is included into linux-next and is updated there every 3-4 working days

------------------------------------------------------
From: Andrew Morton <[email protected]>
Subject: hfsplus-fix-concurrent-acess-of-alloc_blocks-fix

take extents_lock before taking a copy of ->alloc_blocks

Cc Alexey Khoroshilov <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc Sougata Santra <[email protected]>
Cc Vyacheslav Dubeyko <[email protected]>

---

 fs/hfsplus/extents.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
fs/hfsplus/extents.c renamed from fs/hfsplus/extents.c~hfsplus-fix-concurrent-acess-of-alloc_blocks-fix +5 -2
diff -puN fs/hfsplus/extents.c~hfsplus-fix-concurrent-acess-of-alloc_blocks-fix fs/hfsplus/extents.c
@@ -556,11 +556,13 @@ void hfsplus_file_truncate(struct inode
 
 	blk_cnt = (inode->i_size + HFSPLUS_SB(sb)->alloc_blksz - 1) >>
 			HFSPLUS_SB(sb)->alloc_blksz_shift;
+
+	mutex_lock(&hip->extents_lock);
+
 	alloc_cnt = hip->alloc_blocks;
 	if (blk_cnt == alloc_cnt)
-		goto out;
+		goto out_unlock;
 
-	mutex_lock(&hip->extents_lock);
 	res = hfs_find_init(HFSPLUS_SB(sb)->ext_tree, &fd);
 	if (res) {
 		mutex_unlock(&hip->extents_lock);
@@ -594,6 +596,7 @@ void hfsplus_file_truncate(struct inode
 	hfs_find_exit(&fd);
 
 	hip->alloc_blocks = blk_cnt;
+out_unlock:
 	mutex_unlock(&hip->extents_lock);
 out:
 	hip->phys_size = inode->i_size;

_

Patches currently in -mm which might be from [email protected] are

arch-alpha-kernel-systblss-remove-debug-check.patch i-need-old-gcc.patch input-route-kbd-leds-through-the-generic-leds-layer.patch jffs2-avoid-soft-lockup-in-jffs2_reserve_space_gc.patch
mm.patch
mm-hugetlb-improve-page-fault-scalability-fix.patch mm-vmstat-fix-up-zone-state-accounting-fix.patch mm-keep-page-cache-radix-tree-nodes-in-check-fix-fix.patch pagewalk-remove-argument-hmask-from-hugetlb_entry-fix-fix.patch drop_caches-add-some-documentation-and-info-message.patch include-linux-syscallsh-add-sys32_quotactl-prototype-fix.patch sys_sysfs-add-config_sysfs_syscall-fix.patch ncpfs-convert-dprintk-ddprintk-to-ncp_dbg-fix.patch ncpfs-convert-dprintk-ddprintk-to-ncp_dbg-fix-fix.patch hfsplus-fix-concurrent-acess-of-alloc_blocks-fix.patch kmod-run-usermodehelpers-only-on-cpus-allowed-for-kthreadd-v2-fix.patch kmod-run-usermodehelpers-only-on-cpus-allowed-for-kthreadd-v2-checkpatch-fixes.patch include-linux-crash_dumph-add-vmcore_cleanup-prototype-fix.patch kernel-panicc-display-reason-at-end-pr_emerg-fix.patch linux-next.patch
linux-next-rejects.patch
debugging-keep-track-of-page-owners.patch journal_add_journal_head-debug.patch kernel-forkc-export-kernel_thread-to-modules.patch mutex-subsystem-synchro-test-module.patch
slab-leaks3-default-y.patch
put_bh-debug.patch