projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ad3bdef
)
Fix _fat_bmap() locking
author
OGAWA Hirofumi
<
[email protected]
>
Wed, 11 Mar 2009 17:03:23 +0000
(
02:03
+0900)
committer
Linus Torvalds
<
[email protected]
>
Wed, 11 Mar 2009 19:04:18 +0000
(12:04 -0700)
On swapon() path, it has already i_mutex. So, this uses i_alloc_sem
instead of it.
Signed-off-by: OGAWA Hirofumi <
[email protected]
>
Reported-by: Laurent GUERBY <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
fs/fat/inode.c
patch
|
blob
|
history
diff --git
a/fs/fat/inode.c
b/fs/fat/inode.c
index 6b74d09adbe5fa34d425f7b2c07a8271ddcd8e14..de0004fe6e0049c8a09a494444d19831313da64c 100644
(file)
--- a/
fs/fat/inode.c
+++ b/
fs/fat/inode.c
@@
-202,9
+202,9
@@
static sector_t _fat_bmap(struct address_space *mapping, sector_t block)
sector_t blocknr;
/* fat_get_cluster() assumes the requested blocknr isn't truncated. */
-
mutex_lock(&mapping->host->i_mutex
);
+
down_read(&mapping->host->i_alloc_sem
);
blocknr = generic_block_bmap(mapping, block, fat_get_block);
-
mutex_unlock(&mapping->host->i_mutex
);
+
up_read(&mapping->host->i_alloc_sem
);
return blocknr;
}