Linux Container Development
 help / color / mirror / Atom feed
From: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>
To: Matt Helsley <matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Cc: containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
Subject: Re: [PATCH][RFC] checkpoint: refuse to checkpoint if monitoring	directories with dnotify
Date: Thu, 18 Feb 2010 11:52:21 -0500	[thread overview]
Message-ID: <4B7D7045.90305@cs.columbia.edu> (raw)
In-Reply-To: <20100218002422.GG3604-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org>


After self-review:
Acked-by: Oren Laadan <orenl-eQaUEPhvms7ENvBUuze7eA@public.gmane.org>

Will pull for v19.

Oren.

Matt Helsley wrote:
> Reviewing my own patch...
> 
> On Wed, Feb 17, 2010 at 02:10:58PM -0800, Matt Helsley wrote:
> 
> <snip>
> 
>> diff --git a/fs/notify/dnotify/dnotify.c b/fs/notify/dnotify/dnotify.c
>> index 7e54e52..9ce85f5 100644
>> --- a/fs/notify/dnotify/dnotify.c
>> +++ b/fs/notify/dnotify/dnotify.c
>> @@ -289,6 +289,28 @@ static int attach_dn(struct dnotify_struct *dn, struct dnotify_mark_entry *dnent
>>  	return 0;
>>  }
>>
>> +int is_dnotify_attached(struct file *filp)
>> +{
>> +	struct fsnotify_mark_entry *entry;
>> +	struct dnotify_mark_entry *dnentry;
>> +	struct dnotify_struct *dn;
>> +	struct dnotify_struct **prev;
> 
> Ugh, most of these variables aren't needed.
> 
>> +	struct inode *inode;
>> +
>> +	inode = filp->f_path.dentry->d_inode;
>> +	if (!S_ISDIR(inode->i_mode))
>> +		return 0;
>> +
>> +	spin_lock(&inode->i_lock);
>> +	entry = fsnotify_find_mark_entry(dnotify_group, inode);
>> +	spin_unlock(&inode->i_lock);
>> +	if (entry) {
>> +		fsnotify_put_mark(new_entry);
>> +		return 1;
>> +	}
> 
> I flipped the test to look more like normal kernel code and fixed the
> parameter to fsnotify_put_mark():
> 
> 	if (!entry)
> 		return 0;
> 	fsnotify_put_mark(entry);
> 	return 1;
> 
> Cheers,
> 	-Matt Helsley
> _______________________________________________
> Containers mailing list
> Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> https://lists.linux-foundation.org/mailman/listinfo/containers
> 

      parent reply	other threads:[~2010-02-18 16:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-17 22:10 [PATCH][RFC] checkpoint: refuse to checkpoint if monitoring directories with dnotify Matt Helsley
     [not found] ` <06e8a57fc278e96c909ff3c0f1a167cee7a48dd5.1266444614.git.matthltc-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-02-18  0:24   ` Matt Helsley
     [not found]     ` <20100218002422.GG3604-52DBMbEzqgQ/wnmkkaCWp/UQ3DHhIser@public.gmane.org>
2010-02-18 16:52       ` Oren Laadan [this message]

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=4B7D7045.90305@cs.columbia.edu \
    --to=orenl-eqauephvms7envbuuze7ea@public.gmane.org \
    --cc=containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org \
    --cc=matthltc-r/Jw6+rmf7HQT0dZR+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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox