android_kernel_motorola_sm6375/fs/ceph
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Xiubo Li b520f78ba4 ceph: do not execute direct write in parallel if O_APPEND is specified
[ Upstream commit 8e4473bb50a1796c9c32b244e5dbc5ee24ead937 ]

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 <[email protected]>
Reviewed-by: Jeff Layton <[email protected]>
Signed-off-by: Ilya Dryomov <[email protected]>
Signed-off-by: Sasha Levin <[email protected]>
2020-03-05 16:43:38 +01:00
..
acl.c
addr.c
cache.c ceph: include ceph_debug.h in cache.c 2019-09-16 12:06:25 +02:00
cache.h
caps.c ceph: fix use-after-free in __ceph_remove_cap() 2019-10-29 22:29:51 +01:00
ceph_frag.c
debugfs.c
dir.c ceph: fix compat_ioctl for ceph_dir_operations 2019-12-17 19:55:31 +01:00
export.c
file.c ceph: do not execute direct write in parallel if O_APPEND is specified 2020-03-05 16:43:38 +01:00
inode.c ceph: add missing check in d_revalidate snapdir handling 2019-10-29 22:29:55 +01:00
io.c
io.h
ioctl.c
ioctl.h
Kconfig
locks.c
Makefile
mds_client.c ceph: check availability of mds cluster on mount after wait timeout 2020-02-24 08:36:59 +01:00
mds_client.h
mdsmap.c
quota.c
snap.c
strings.c
super.c ceph: check availability of mds cluster on mount after wait timeout 2020-02-24 08:36:59 +01:00
super.h
xattr.c