diff options
author | Hunter Adrian <adrian.hunter@nokia.com> | 2009-05-14 04:32:30 (GMT) |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2009-05-19 08:01:31 (GMT) |
commit | 8b3884a841f398f6e0a0411d6929d8d9381bb265 (patch) | |
tree | 01bbbaad779c43b14ea3e809c5fc9271eca257d4 /drivers/char/hw_random/n2-asm.S | |
parent | 6d6cb0d688d0f262cb4fd5771648b0ac01d4f82c (diff) | |
download | linux-fsl-qoriq-8b3884a841f398f6e0a0411d6929d8d9381bb265.tar.xz |
UBIFS: return error if link and unlink race
Consider a scenario when 'vfs_link(dirA/fileA)' and
'vfs_unlink(dirA/fileA, dirB/fileB)' race. 'vfs_link()' does not
lock 'dirA->i_mutex', so this is possible. Both of the functions
lock 'fileA->i_mutex' though. Suppose 'vfs_unlink()' wins, and takes
'fileA->i_mutex' mutex first. Suppose 'fileA->i_nlink' is 1. In this
case 'ubifs_unlink()' will drop the last reference, and put 'inodeA'
to the list of orphans. After this, 'vfs_link()' will link
'dirB/fileB' to 'inodeA'. Thir is a problem because, for example,
the subsequent 'vfs_unlink(dirB/fileB)' will add the same inode
to the list of orphans.
This problem was reported by J. R. Okajima <hooanon05@yahoo.co.jp>
[Artem: add more comments, amended commit message]
Signed-off-by: Adrian Hunter <adrian.hunter@nokia.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Diffstat (limited to 'drivers/char/hw_random/n2-asm.S')
0 files changed, 0 insertions, 0 deletions