fury: check inode's i_private before assignation
Chun Xu [Fri, 16 May 2014 11:18:28 +0000 (19:18 +0800)]
Bug 200000044

Change-Id: I4a09caf016193801c5841b82e024f8ef41a3763f
Signed-off-by: Chun Xu <chunx@nvidia.com>
Reviewed-on: http://git-master/r/411287
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Naveen Kumar S <nkumars@nvidia.com>
Tested-by: Naveen Kumar S <nkumars@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Winnie Hsu <whsu@nvidia.com>

fs/eventpoll.c

index ab21578..047accd 100644 (file)
@@ -9,7 +9,7 @@
  *
  *  Davide Libenzi <davidel@xmailserver.org>
  *
- * Copyright (c) 2013, NVIDIA CORPORATION.  All rights reserved.
+ * Copyright (c) 2013-2014, NVIDIA CORPORATION.  All rights reserved.
  *
  */
 
@@ -1290,7 +1290,9 @@ static int ep_insert(struct eventpoll *ep, struct epoll_event *event,
        spin_lock(&tfile->f_lock);
        list_add_tail(&epi->fllink, &tfile->f_ep_links);
        spin_unlock(&tfile->f_lock);
-       tfile->f_path.dentry->d_inode->i_private = get_thread_process(current);
+       if (tfile->f_path.dentry->d_inode->i_private == NULL)
+               tfile->f_path.dentry->d_inode->i_private =
+                       get_thread_process(current);
 
        /*
         * Add the current item to the RB tree. All RB tree operations are