On Fri, Feb 22, 2019 at 06:16:40PM +0800, Qu Wenruo wrote: > To inform later developers how to check the return value of it. > > Signed-off-by: Qu Wenruo <w...@suse.com> > --- > fs/btrfs/extent_io.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/fs/btrfs/extent_io.c b/fs/btrfs/extent_io.c > index 52abe4082680..b28a75546700 100644 > --- a/fs/btrfs/extent_io.c > +++ b/fs/btrfs/extent_io.c > @@ -4890,6 +4890,13 @@ struct extent_buffer *alloc_test_extent_buffer(struct > btrfs_fs_info *fs_info, > } > #endif > > +/* > + * Allocate an extent buffer structure, with all its pages attached and > locked. > + * > + * Return valid pointer if nothing goes wrong. > + * Return PTR_ERR() if failed. > + * Will never return NULL.
I'd rather drop this as it depends on another function and the GFP_NOFAIL flag that will be removed eventually. The PTR_ERR covers ENOMEM and allocation failures.