diff options
author | Xiubo Li <xiubli@redhat.com> | 2020-02-03 21:28:25 -0500 |
---|---|---|
committer | Ilya Dryomov <idryomov@gmail.com> | 2020-02-11 17:04:04 +0100 |
commit | 8e4473bb50a1796c9c32b244e5dbc5ee24ead937 (patch) | |
tree | 7de41d8d856fcca65497e08059ea660f682295d9 /drivers/cpufreq/scmi-cpufreq.c | |
parent | bb6d3fb354c5ee8d6bde2d576eb7220ea09862b9 (diff) | |
download | linux-8e4473bb50a1796c9c32b244e5dbc5ee24ead937.tar.bz2 |
ceph: do not execute direct write in parallel if O_APPEND is specified
In O_APPEND & O_DIRECT mode, the data from different writers will
be possibly overlapping each other since they take the shared lock.
For example, both Writer1 and Writer2 are in O_APPEND and O_DIRECT
mode:
Writer1 Writer2
shared_lock() shared_lock()
getattr(CAP_SIZE) getattr(CAP_SIZE)
iocb->ki_pos = EOF iocb->ki_pos = EOF
write(data1)
write(data2)
shared_unlock() shared_unlock()
The data2 will overlap the data1 from the same file offset, the
old EOF.
Switch to exclusive lock instead when O_APPEND is specified.
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Diffstat (limited to 'drivers/cpufreq/scmi-cpufreq.c')
0 files changed, 0 insertions, 0 deletions