/* * Coda File System, Linux Kernel module * * Original version, adapted from cfs_mach.c, (C) Carnegie Mellon University * Linux modifications (C) 1996, Peter J. Braam * Rewritten for Linux 2.1 (C) 1997 Carnegie Mellon University * * Carnegie Mellon University encourages users of this software to * contribute improvements to the Coda project. */ #ifndef _LINUX_CODA_FS #define _LINUX_CODA_FS #ifdef pr_fmt #undef pr_fmt #endif #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt #include #include #include #include #include #include #include #include #include "coda_fs_i.h" /* operations */ extern const struct inode_operations coda_dir_inode_operations; extern const struct inode_operations coda_file_inode_operations; extern const struct inode_operations coda_ioctl_inode_operations; extern const struct dentry_operations coda_dentry_operations; extern const struct address_space_operations coda_file_aops; extern const struct address_space_operations coda_symlink_aops; extern const struct file_operations coda_dir_operations; extern const struct file_operations coda_file_operations; extern const struct file_operations coda_ioctl_operations; /* operations shared over more than one file */ int coda_open(struct inode *i, struct file *f); int coda_release(struct inode *i, struct file *f); int coda_permission(struct inode *inode, int mask); int coda_revalidate_inode(struct inode *); int coda_getattr(struct vfsmount *, struct dentry *, struct kstat *); int coda_setattr(struct dentry *, struct iattr *); /* this file: heloers */ char *coda_f2s(struct CodaFid *f); int coda_iscontrol(const char *name, size_t length); void coda_vattr_to_iattr(struct inode *, struct coda_vattr *); void coda_iattr_to_vattr(struct iattr *, struct coda_vattr *); unsigned short coda_flags_to_cflags(unsigned short); /* sysctl.h */ void coda_sysctl_init(void); void coda_sysctl_clean(void); #define CODA_ALLOC(ptr, cast, size) do { \ if (size < PAGE_SIZE) \ ptr = kzalloc((unsigned long) size, GFP_KERNEL); \ else \ ptr = (cast)vzalloc((unsigned long) size); \ if (!ptr) \ pr_warn("kernel malloc returns 0 at %s:%d\n", __FILE__, __LINE__); \ } while (0) #define CODA_FREE(ptr, size) kvfree((ptr)) /* inode to cnode access functions */ static inline struct coda_inode_info *ITOC(struct inode *inode) { return container_of(inode, struct coda_inode_info, vfs_inode); } static __inline__ struct CodaFid *coda_i2f(struct inode *inode) { return &(ITOC(inode)->c_fid); } static __inline__ char *coda_i2s(struct inode *inode) { return coda_f2s(&(ITOC(inode)->c_fid)); } /* this will not zap the inode away */ static __inline__ void coda_flag_inode(struct inode *inode, int flag) { struct coda_inode_info *cii = ITOC(inode); spin_lock(&cii->c_lock); cii->c_flags |= flag; spin_unlock(&cii->c_lock); } #endif it/commit/?h=nds-private-remove&id=07cd12945551b63ecb1a349d50a6d69d1d6feb4a'>root/drivers/usb/dwc3/Makefile
diff options
context:
space:
mode:
authorTejun Heo <tj@kernel.org>2017-01-26 16:47:28 -0500
committerTejun Heo <tj@kernel.org>2017-01-26 16:47:28 -0500
commit07cd12945551b63ecb1a349d50a6d69d1d6feb4a (patch)
tree75f65eba7eac9277971082a2d5a4cf1370562c0c /drivers/usb/dwc3/Makefile
parent7ce7d89f48834cefece7804d38fc5d85382edf77 (diff)
cgroup: don't online subsystems before cgroup_name/path() are operational
While refactoring cgroup creation, a5bca2152036 ("cgroup: factor out cgroup_create() out of cgroup_mkdir()") incorrectly onlined subsystems before the new cgroup is associated with it kernfs_node. This is fine for cgroup proper but cgroup_name/path() depend on the associated kernfs_node and if a subsystem makes the new cgroup_subsys_state visible, which they're allowed to after onlining, it can lead to NULL dereference. The current code performs cgroup creation and subsystem onlining in cgroup_create() and cgroup_mkdir() makes the cgroup and subsystems visible afterwards. There's no reason to online the subsystems early and we can simply drop cgroup_apply_control_enable() call from cgroup_create() so that the subsystems are onlined and made visible at the same time. Signed-off-by: Tejun Heo <tj@kernel.org> Reported-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru> Fixes: a5bca2152036 ("cgroup: factor out cgroup_create() out of cgroup_mkdir()") Cc: stable@vger.kernel.org # v4.6+
Diffstat (limited to 'drivers/usb/dwc3/Makefile')