All of lore.kernel.org
 help / color / mirror / Atom feed
From: Shamir Rabinovitch <shamir.rabinovitch-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
To: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org,
	vijay.ac.kumar-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org
Subject: Re: [PATCH v3] IB/IPoIB: ibX: failed to create mcg debug file
Date: Tue, 28 Mar 2017 12:19:41 +0300	[thread overview]
Message-ID: <20170328091940.GA14058@srabinov-linux.uk.oracle.com> (raw)
In-Reply-To: <20170327201714.GB29831-t9juWtktDCT52KUv/Ok+f8QLKKaP9WJ9VpNB7YpNyf8@public.gmane.org>

On Mon, Mar 27, 2017 at 11:17:14PM +0300, Shamir Rabinovitch wrote:
> 
> > >
> > > +#ifdef CONFIG_INFINIBAND_IPOIB_DEBUG
> > > +static int ipoib_netdev_event(struct notifier_block *this,
> > > +			      unsigned long event, void *ptr)
> > > +{
> > > +	struct netdev_notifier_info *ni = ptr;
> > > +	struct net_device *dev = ni->dev;
> > > +
> > > +	if (dev->netdev_ops->ndo_open != ipoib_open)
> > > +		return NOTIFY_DONE;
> > > +
> > > +	switch (event) {
> > > +	case NETDEV_REGISTER:
> > > +		ipoib_create_debug_files(dev);
> > > +		break;
> > > +	case NETDEV_CHANGENAME:
> > > +		ipoib_debugfs_rename(dev);
> > 
> > Why do we need explicit ipoib_debugfs_rename function?
> > Will it work by simply calling ipoib_delete_debug_files
> > and immediately after that ipoib_create_debug_files?
> > 
> > 
> > > +		break;
> > > +	case NETDEV_UNREGISTER:
> > > +		ipoib_delete_debug_files(dev);
> > > +		break;
> > > +	}
> > > +
> > > +	return NOTIFY_DONE;
> > > +}
> > > +#endif
> > > +
> 
> Hi Leon, 
> 
> Good point. 
> I will have look on this idea and get back to you.
> 
> BR, Shamir

Hi Leon,

It seems that the difference between using debugfs_rename and a
combination of debugfs_create_file and debugfs_remove is mainly the
atomicy of the rename operation with regard to the file system.
debugfs_rename is atomic operation while the above combination is not.
As result I see kernel panic when the rename operation interleave with
the delete due to module unload. So after carefully considering what you
suggest I think it might introduce unexpected issues.

BR, Shamir  
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2017-03-28  9:19 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-27  7:18 [PATCH v3] IB/IPoIB: ibX: failed to create mcg debug file Shamir Rabinovitch
     [not found] ` <1490599139-12665-1-git-send-email-shamir.rabinovitch-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2017-03-27 15:06   ` Mark Bloch
     [not found]     ` <4058624b-a947-9635-76ca-482fd6a6bd95-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-03-27 20:11       ` Shamir Rabinovitch
     [not found]         ` <20170327201156.GA29831-t9juWtktDCT52KUv/Ok+f8QLKKaP9WJ9VpNB7YpNyf8@public.gmane.org>
2017-03-28 15:45           ` Mark Bloch
     [not found]             ` <a141c94a-63b7-491c-ce42-9b8cb08aeb93-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-03-28 16:02               ` Shamir Rabinovitch
     [not found]                 ` <20170328160251.GA26781-t9juWtktDCT52KUv/Ok+f8QLKKaP9WJ9VpNB7YpNyf8@public.gmane.org>
2017-03-28 16:49                   ` Mark Bloch
     [not found]                     ` <e3a49c96-b248-7491-301d-faa47109aa41-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
2017-03-28 17:52                       ` Shamir Rabinovitch
2017-03-27 19:55   ` Leon Romanovsky
     [not found]     ` <20170327195500.GH20443-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-03-27 20:17       ` Shamir Rabinovitch
     [not found]         ` <20170327201714.GB29831-t9juWtktDCT52KUv/Ok+f8QLKKaP9WJ9VpNB7YpNyf8@public.gmane.org>
2017-03-28  9:19           ` Shamir Rabinovitch [this message]
     [not found]             ` <20170328091940.GA14058-t9juWtktDCT52KUv/Ok+f8QLKKaP9WJ9VpNB7YpNyf8@public.gmane.org>
2017-03-28 17:05               ` Leon Romanovsky
     [not found]                 ` <20170328170506.GI20443-U/DQcQFIOTAAJjI8aNfphQ@public.gmane.org>
2017-03-29 10:20                   ` Shamir Rabinovitch
     [not found]                     ` <20170329102019.GA19012-t9juWtktDCT52KUv/Ok+f8QLKKaP9WJ9VpNB7YpNyf8@public.gmane.org>
2017-03-29 11:21                       ` Leon Romanovsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170328091940.GA14058@srabinov-linux.uk.oracle.com \
    --to=shamir.rabinovitch-qhclzuegtsvqt0dzr+alfa@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=vijay.ac.kumar-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.