diff options
author | OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> | 2009-03-12 02:03:23 +0900 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-03-11 12:04:18 -0700 |
commit | 3a95ea1155c5d44aa58dde2f64f0ddafe27fd1fb (patch) | |
tree | de6d6392c58a37a7f13bacf899b3f56c32fabcf4 /fs/fat | |
parent | ad3bdefe877afb47480418fdb05ecd42842de65e (diff) | |
download | kernel_samsung_smdk4412-3a95ea1155c5d44aa58dde2f64f0ddafe27fd1fb.tar.gz kernel_samsung_smdk4412-3a95ea1155c5d44aa58dde2f64f0ddafe27fd1fb.tar.bz2 kernel_samsung_smdk4412-3a95ea1155c5d44aa58dde2f64f0ddafe27fd1fb.zip |
Fix _fat_bmap() locking
On swapon() path, it has already i_mutex. So, this uses i_alloc_sem
instead of it.
Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Reported-by: Laurent GUERBY <laurent@guerby.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/fat')
-rw-r--r-- | fs/fat/inode.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/fs/fat/inode.c b/fs/fat/inode.c index 6b74d09adbe..de0004fe6e0 100644 --- 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; } |