diff options
| author | OGAWA Hirofumi <[email protected]> | 2019-09-23 15:32:53 -0700 |
|---|---|---|
| committer | Linus Torvalds <[email protected]> | 2019-09-24 15:54:06 -0700 |
| commit | 07bfa4415ab607e459b69bd86aa7e7602ce10b4f (patch) | |
| tree | 62a7bc60deca51a1a795c8a22293e658d88efc07 /include | |
| parent | 619e17cf75dd58905aa67ccd494a6ba5f19d6cc6 (diff) | |
fat: work around race with userspace's read via blockdev while mounting
If userspace reads the buffer via blockdev while mounting,
sb_getblk()+modify can race with buffer read via blockdev.
For example,
FS userspace
bh = sb_getblk()
modify bh->b_data
read
ll_rw_block(bh)
fill bh->b_data by on-disk data
/* lost modified data by FS */
set_buffer_uptodate(bh)
set_buffer_uptodate(bh)
Userspace should not use the blockdev while mounting though, the udev
seems to be already doing this. Although I think the udev should try to
avoid this, workaround the race by small overhead.
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: OGAWA Hirofumi <[email protected]>
Reported-by: Jan Stancek <[email protected]>
Tested-by: Jan Stancek <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions