Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 94e07a75 authored by Namjae Jeon's avatar Namjae Jeon Committed by Al Viro
Browse files

fs: encode_fh: return FILEID_INVALID if invalid fid_type



This patch is a follow up on below patch:

[PATCH] exportfs: add FILEID_INVALID to indicate invalid fid_type
commit: 216b6cbd

Signed-off-by: default avatarNamjae Jeon <namjae.jeon@samsung.com>
Signed-off-by: default avatarVivek Trivedi <t.vivek@samsung.com>
Acked-by: default avatarSteven Whitehouse <swhiteho@redhat.com>
Acked-by: default avatarSage Weil <sage@inktank.com>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent 182be684
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -22,10 +22,10 @@ static int btrfs_encode_fh(struct inode *inode, u32 *fh, int *max_len,

	if (parent && (len < BTRFS_FID_SIZE_CONNECTABLE)) {
		*max_len = BTRFS_FID_SIZE_CONNECTABLE;
		return 255;
		return FILEID_INVALID;
	} else if (len < BTRFS_FID_SIZE_NON_CONNECTABLE) {
		*max_len = BTRFS_FID_SIZE_NON_CONNECTABLE;
		return 255;
		return FILEID_INVALID;
	}

	len  = BTRFS_FID_SIZE_NON_CONNECTABLE;
+2 −2
Original line number Diff line number Diff line
@@ -81,7 +81,7 @@ static int ceph_encode_fh(struct inode *inode, u32 *rawfh, int *max_len,
		if (parent_inode) {
			/* nfsd wants connectable */
			*max_len = connected_handle_length;
			type = 255;
			type = FILEID_INVALID;
		} else {
			dout("encode_fh %p\n", dentry);
			fh->ino = ceph_ino(inode);
@@ -90,7 +90,7 @@ static int ceph_encode_fh(struct inode *inode, u32 *rawfh, int *max_len,
		}
	} else {
		*max_len = handle_length;
		type = 255;
		type = FILEID_INVALID;
	}
	if (dentry)
		dput(dentry);
+1 −1
Original line number Diff line number Diff line
@@ -678,7 +678,7 @@ static int fuse_encode_fh(struct inode *inode, u32 *fh, int *max_len,

	if (*max_len < len) {
		*max_len = len;
		return  255;
		return  FILEID_INVALID;
	}

	nodeid = get_fuse_inode(inode)->nodeid;
+2 −2
Original line number Diff line number Diff line
@@ -37,10 +37,10 @@ static int gfs2_encode_fh(struct inode *inode, __u32 *p, int *len,

	if (parent && (*len < GFS2_LARGE_FH_SIZE)) {
		*len = GFS2_LARGE_FH_SIZE;
		return 255;
		return FILEID_INVALID;
	} else if (*len < GFS2_SMALL_FH_SIZE) {
		*len = GFS2_SMALL_FH_SIZE;
		return 255;
		return FILEID_INVALID;
	}

	fh[0] = cpu_to_be32(ip->i_no_formal_ino >> 32);
+2 −2
Original line number Diff line number Diff line
@@ -125,10 +125,10 @@ isofs_export_encode_fh(struct inode *inode,
	 */
	if (parent && (len < 5)) {
		*max_len = 5;
		return 255;
		return FILEID_INVALID;
	} else if (len < 3) {
		*max_len = 3;
		return 255;
		return FILEID_INVALID;
	}

	len = 3;
Loading