Re: [PATCH] ceph: make the lost+found dir accessible by kernel client

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 2021-04-19 at 10:32 +0800, xiubli@xxxxxxxxxx wrote:
> From: Xiubo Li <xiubli@xxxxxxxxxx>
> 
> Inode number 0x4 is reserved for the lost+found dir, and the app
> or test app need to access it.
> 
> URL: https://tracker.ceph.com/issues/50216
> Signed-off-by: Xiubo Li <xiubli@xxxxxxxxxx>
> ---
>  fs/ceph/super.h              | 3 ++-
>  include/linux/ceph/ceph_fs.h | 7 ++++---
>  2 files changed, 6 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/ceph/super.h b/fs/ceph/super.h
> index 4808a1458c9b..0f38e6183ff0 100644
> --- a/fs/ceph/super.h
> +++ b/fs/ceph/super.h
> @@ -542,7 +542,8 @@ static inline int ceph_ino_compare(struct inode *inode, void *data)
>  
> 
> 
> 
>  static inline bool ceph_vino_is_reserved(const struct ceph_vino vino)
>  {
> -	if (vino.ino < CEPH_INO_SYSTEM_BASE && vino.ino != CEPH_INO_ROOT) {
> +	if (vino.ino < CEPH_INO_SYSTEM_BASE && vino.ino != CEPH_INO_ROOT &&
> +	    vino.ino != CEPH_INO_LOST_AND_FOUND ) {
>  		WARN_RATELIMIT(1, "Attempt to access reserved inode number 0x%llx", vino.ino);
>  		return true;
>  	}
> diff --git a/include/linux/ceph/ceph_fs.h b/include/linux/ceph/ceph_fs.h
> index e41a811026f6..57e5bd63fb7a 100644
> --- a/include/linux/ceph/ceph_fs.h
> +++ b/include/linux/ceph/ceph_fs.h
> @@ -27,9 +27,10 @@
>  #define CEPH_MONC_PROTOCOL   15 /* server/client */
>  
> 
> 
> 
>  
> 
> 
> 
> -#define CEPH_INO_ROOT   1
> -#define CEPH_INO_CEPH   2       /* hidden .ceph dir */
> -#define CEPH_INO_DOTDOT 3	/* used by ceph fuse for parent (..) */
> +#define CEPH_INO_ROOT           1
> +#define CEPH_INO_CEPH           2 /* hidden .ceph dir */
> +#define CEPH_INO_DOTDOT         3 /* used by ceph fuse for parent (..) */
> +#define CEPH_INO_LOST_AND_FOUND 4 /* lost+found dir */
>  
> 
> 
> 
>  /* arbitrary limit on max # of monitors (cluster of 3 is typical) */
>  #define CEPH_MAX_MON   31

Thanks Xiubo,

For some background, apparently cephfs-data-scan can create this
directory, and the clients do need access to it. I'll fold this into the
original patch that makes these inodes inaccessible (ceph: don't allow
access to MDS-private inodes).

Cheers!
-- 
Jeff Layton <jlayton@xxxxxxxxxx>




[Index of Archives]     [CEPH Users]     [Ceph Large]     [Ceph Dev]     [Information on CEPH]     [Linux BTRFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux