]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit - fs/ceph/file.c
ceph: only allow punch hole mode in fallocate
authorLuis Henriques <lhenriques@suse.com>
Tue, 9 Oct 2018 17:54:28 +0000 (18:54 +0100)
committerIlya Dryomov <idryomov@gmail.com>
Mon, 22 Oct 2018 08:28:20 +0000 (10:28 +0200)
commitbddff633ab7bc60a18a86ac8b322695b6f8594d0
tree5b8c439ead3fd1c9ff42ad681149d76aa3eaaee7
parentfce7a9744bdf3baa9d08c52d2c78f53ab49918a4
ceph: only allow punch hole mode in fallocate

Current implementation of cephfs fallocate isn't correct as it doesn't
really reserve the space in the cluster, which means that a subsequent
call to a write may actually fail due to lack of space.  In fact, it is
currently possible to fallocate an amount space that is larger than the
free space in the cluster.  It has behaved this way since the initial
commit ad7a60de882a ("ceph: punch hole support").

Since there's no easy solution to fix this at the moment, this patch
simply removes support for all fallocate operations but
FALLOC_FL_PUNCH_HOLE (which implies FALLOC_FL_KEEP_SIZE).

Link: https://tracker.ceph.com/issues/36317
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
fs/ceph/file.c