summaryrefslogtreecommitdiff
path: root/fs/ceph/super.c
diff options
context:
space:
mode:
authorXiubo Li <xiubli@redhat.com>2020-02-03 21:28:25 -0500
committerIlya Dryomov <idryomov@gmail.com>2020-02-11 17:04:04 +0100
commit8e4473bb50a1796c9c32b244e5dbc5ee24ead937 (patch)
tree7de41d8d856fcca65497e08059ea660f682295d9 /fs/ceph/super.c
parentbb6d3fb354c5ee8d6bde2d576eb7220ea09862b9 (diff)
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 'fs/ceph/super.c')
0 files changed, 0 insertions, 0 deletions