]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
ceph: only allow punch hole mode in fallocate
authorLuis Henriques <lhenriques@suse.com>
Tue, 9 Oct 2018 17:54:28 +0000 (18:54 +0100)
committerMarcelo Henrique Cerri <marcelo.cerri@canonical.com>
Fri, 17 Jan 2020 17:21:16 +0000 (14:21 -0300)
commit286a4648e84da88ef935f8465d35095bbdfe0b50
treefe040df99e43338385dc6ee238305c26bc22f3f2
parentc328ab29cfb39150af0277542f88d0adea8434c3
ceph: only allow punch hole mode in fallocate

BugLink: https://bugs.launchpad.net/bugs/1854975
[ Upstream commit bddff633ab7bc60a18a86ac8b322695b6f8594d0 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com>
fs/ceph/file.c