Re: [PATCH v2 1/2] nfsd: Add ALLOCATE support

Christoph Hellwig
2014-10-28T08:41:09Z

> + error = vfs_fallocate(file, flags, offset, len);
> + if (error == -ENODEV)
> + return nfserr_inval;
> + else if (error < 0)
> + return nfserrno(error);
> + return nfserrno(commit_metadata(fhp));

Shouldn't this be something like:

error = vfs_fallocate(file, flags, offset, len);
if (!error)
error = commit_metadata(fhp);

if (error == -ENODEV)
return nfserr_inval;
return nfserrno(error);

I think we really should move the ENODEV mapping to nfserrno, but
this patch isn't the right place for that.