Re: [PATCH 1/4] fs/notify: fdinfo can report unsupported file handles.

From: Al Viro
Date: Mon Dec 11 2017 - 01:29:56 EST


On Mon, Dec 11, 2017 at 05:04:05PM +1100, NeilBrown wrote:
> @@ -385,7 +385,9 @@ int exportfs_encode_inode_fh(struct inode *inode, struct fid *fid,
> {
> const struct export_operations *nop = inode->i_sb->s_export_op;
>
> - if (nop && nop->encode_fh)
> + if (nop)
> + return FILEID_INVALID;
> + if (nop->encode_fh)
> return nop->encode_fh(inode, fid->raw, max_len, parent);

This might as well have been

if (nop)
return FILEID_INVALID;
BUG();

Have you ever tested that?