Deleting entries in lost+found directory is suggested once users
are done with those entries (possibly, by copying them), however,
unlinking is disallowed by the gating the operation via -EROFS.
Remove this constraint.
Fixes: http://tracker.ceph.com/issues/59569
Signed-off-by: Venky Shankar <vshankar@redhat.com>
bool is_mdsdir() const { return MDS_INO_IS_MDSDIR(ino()); }
bool is_base() const { return MDS_INO_IS_BASE(ino()); }
bool is_system() const { return ino() < MDS_INO_SYSTEM_BASE; }
+ bool is_lost_and_found() const { return ino() == CEPH_INO_LOST_AND_FOUND; }
bool is_normal() const { return !(is_base() || is_system() || is_stray()); }
bool is_file() const { return get_inode()->is_file(); }
bool is_symlink() const { return get_inode()->is_symlink(); }
CInode *diri = dir->get_inode();
if (!mdr->reqid.name.is_mds()) {
- if (diri->is_system() && !diri->is_root()) {
+ if (diri->is_system() && !diri->is_root() &&
+ (!diri->is_lost_and_found() ||
+ mdr->client_request->get_op() != CEPH_MDS_OP_UNLINK)) {
respond_to_request(mdr, -CEPHFS_EROFS);
return nullptr;
}