On Tue, Feb 18, 2020 at 04:24:32PM +0100, Christoph Hellwig wrote: > On Tue, Feb 18, 2020 at 09:15:39AM +1100, Dave Chinner wrote: > > > > > > - ops[i].am_error = strncpy_from_user((char *)attr_name, > > > - ops[i].am_attrname, MAXNAMELEN); > > > - if (ops[i].am_error == 0 || ops[i].am_error == MAXNAMELEN) > > > - error = -ERANGE; > > > - if (ops[i].am_error < 0) > > > + attr_name = strndup_user(ops[i].am_attrname, MAXNAMELEN); > > > + if (IS_ERR(attr_name)) { > > > + ops[i].am_error = PTR_ERR(attr_name); > > > break; > > > + } > > > > This changes the error returned for an invalid attr name length from > > -ERANGE to either -EINVAL or -EFAULT. Can you please document that > > in the commit message. This change requires updates to the > > path_to_handle(3) man page shipped in xfsprogs in the xfslibs-dev > > package (xfsprogs::man/man3/handle.3) to document the differences in > > return values. > > I can't find that man page documenting -ERANGE at all.. Should we add both to the errors list, then? Seeing as (I think?) the kernel can actually return this... --D