Re: [PATCH] btrfs: remove unnecessary if judge

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, May 21, 2018 at 05:32:14PM +0800, Gu Jinxiang wrote:
> Since add_excluded_extent always returns 0,
> no need to judge ret.

The whole calltree starting in this function needs to be examined, if
there's a function that can retrun value (like set_extent_bits) or if
there's a BUG_ON that needs to be turned to proper error handling and
pushed upwards eventually.

When dealing with deep call sequences, it's fine and actually
recommended to do one step at a time. See eg. 57599c7e7722daf5 .

Do all necessary error handling in the function (undo changes, free
resources, etc) and return a value. The caller that does not handle the
return value at all will get the BUG_ON and will be converted the same
way in next patch.
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux