From: Venky Shankar Date: Wed, 19 Apr 2023 07:09:04 +0000 (-0400) Subject: mds: allow unlink operation under lost+found directory X-Git-Tag: v19.0.0~1246^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=241b9396dbc6d506cef297bdb89ab07fe3a7ce02;p=ceph.git mds: allow unlink operation under lost+found directory 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 --- diff --git a/src/mds/CInode.h b/src/mds/CInode.h index 3f18ab0fe864..2f7d6d242b89 100644 --- a/src/mds/CInode.h +++ b/src/mds/CInode.h @@ -657,6 +657,7 @@ class CInode : public MDSCacheObject, public InodeStoreBase, public Counteris_file(); } bool is_symlink() const { return get_inode()->is_symlink(); } diff --git a/src/mds/Server.cc b/src/mds/Server.cc index b0f4db315389..4fb66f91ad12 100644 --- a/src/mds/Server.cc +++ b/src/mds/Server.cc @@ -3693,7 +3693,9 @@ CDentry* Server::rdlock_path_xlock_dentry(MDRequestRef& mdr, 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; }