From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx2.suse.de ([195.135.220.15]:59308 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751142AbdLPGzz (ORCPT ); Sat, 16 Dec 2017 01:55:55 -0500 Subject: Re: [PATCH 4/6] btrfs: make btrfs_free_stale_device() argument optional To: Anand Jain , linux-btrfs@vger.kernel.org References: <20171215034739.26090-1-anand.jain@oracle.com> <20171215034739.26090-5-anand.jain@oracle.com> From: Nikolay Borisov Message-ID: Date: Sat, 16 Dec 2017 08:55:53 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Sender: linux-btrfs-owner@vger.kernel.org List-ID: On 16.12.2017 04:14, Anand Jain wrote: >         /* >>> @@ -637,8 +632,11 @@ static void btrfs_free_stale_device(struct >>> btrfs_device *cur_dev) >>>                * either use mapper or non mapper path throughout. >>>                */ >>>               rcu_read_lock(); >>> -            not_found = strcmp(rcu_str_deref(dev->name), >>> -                        rcu_str_deref(cur_dev->name)); >>> +            if (cur_dev) >>> +                not_found = strcmp(rcu_str_deref(dev->name), >>> +                           rcu_str_deref(cur_dev->name)); >>> +            else >>> +                not_found = 0; >> >> nit: Perhaps put a proper documentation header at the beginning of the >> function detailing this behavior. I.e. >> >> /* >>   * btrfs_free_stale_device >>   * .... >> > >  Right. Will add. I posted this comment before reading your other patches, having done that I'd say it's best to add the documentation once all the cleanups have been done, since you also add another semantics with the "path" argument. > > Thanks, Anand > >