On Wed, Oct 18, 2023 at 6:18 PM Chuck Lever <chuck.lever@xxxxxxxxxx> wrote: > > On Wed, Oct 18, 2023 at 12:59:58PM +0300, Amir Goldstein wrote: > > export_operations ->encode_fh() no longer has a default implementation to > > encode FILEID_INO32_GEN* file handles. > > > > Rename the default helper for encoding FILEID_INO32_GEN* file handles to > > generic_encode_ino32_fh() and convert the filesystems that used the > > default implementation to use the generic helper explicitly. > > > > This is a step towards allowing filesystems to encode non-decodeable file > > handles for fanotify without having to implement any export_operations. > > > > Signed-off-by: Amir Goldstein <amir73il@xxxxxxxxx> > > --- [...] > > diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h > > index 5b3c9f30b422..6b6e01321405 100644 > > --- a/include/linux/exportfs.h > > +++ b/include/linux/exportfs.h > > @@ -235,7 +235,7 @@ extern int exportfs_encode_fh(struct dentry *dentry, struct fid *fid, > > > > static inline bool exportfs_can_encode_fid(const struct export_operations *nop) > > { > > - return nop; > > + return nop && nop->encode_fh; > > The ->encode_fh() method returns an integer type, not a boolean. It > would be more clear if this were written > > return nop && (nop->encode_fh != FILEID_ROOT); > > (I'm just guessing at what you might have intended). > You must be pre-coffee ;) This checks if the method exists, it doesn't invoke the method. Thanks, Amir.