Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363249
b: refs/heads/master
c: bb2b005
h: refs/heads/master
i:
  363247: f76142a
v: v3
  • Loading branch information
Ming Lei authored and Greg Kroah-Hartman committed Apr 5, 2013
1 parent 6d38c62 commit 478afd4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bcfb87fb75fa3a9b96c8a73d19166897d167fe3f
refs/heads/master: bb2b0051d7b0772ea9d0b4be900c2d965093f5d7
9 changes: 8 additions & 1 deletion trunk/fs/sysfs/dir.c
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ void release_sysfs_dirent(struct sysfs_dirent * sd)
*/
parent_sd = sd->s_parent;

WARN(!(sd->s_flags & SYSFS_FLAG_REMOVED),
"sysfs: free using entry: %s/%s\n",
parent_sd ? parent_sd->s_name : "", sd->s_name);

if (sysfs_type(sd) == SYSFS_KOBJ_LINK)
sysfs_put(sd->s_symlink.target_sd);
if (sysfs_type(sd) & SYSFS_COPY_NAME)
Expand Down Expand Up @@ -386,7 +390,7 @@ struct sysfs_dirent *sysfs_new_dirent(const char *name, umode_t mode, int type)

sd->s_name = name;
sd->s_mode = mode;
sd->s_flags = type;
sd->s_flags = type | SYSFS_FLAG_REMOVED;

return sd;

Expand Down Expand Up @@ -466,6 +470,9 @@ int __sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd)
ps_iattrs->ia_ctime = ps_iattrs->ia_mtime = CURRENT_TIME;
}

/* Mark the entry added into directory tree */
sd->s_flags &= ~SYSFS_FLAG_REMOVED;

return 0;
}

Expand Down

0 comments on commit 478afd4

Please sign in to comment.