原帖由 sisi8408 于 2007-8-18 13:49 发表
这里搜集/整理/讨论 linux 八哥/漏洞,和解决方案
贴八哥/漏洞,一次性获得¥1,最多¥2。
贴解决方案,一次性获得¥1,最多¥9。
1,如果要求任何版权,sisi8408只承诺 版权归地球人,与GPLvx无关 ...
原帖由 sisi8408 于 2007-8-19 11:59 发表
1,敬仰 提交了不少bug给Solaris。
如果能在CU分享,俺看就是美事。
还是那句话,您能来发贴,俺就欢迎、知足。呵呵,满意的笑容。
2,提交和搜集不矛盾,也不冲突。 区别只在于GPL。
想贴 ...
原帖由 sisi8408 于 2007-8-23 11:37 发表 [url=http://linux.chinaunix.net/bbs/redirect.php?goto=findpost&&
void shrink_dcache_sb(struct super_block * sb)
{
struct list_head *tmp, *next;
struct dentry *dentry;
/*
* Pass one ... move the dentries for the specified
* superblock to the most recent end of the unused list.
*/
spin_lock(&dcache_lock);
list_for_each_safe(tmp, next, &dentry_unused) {
dentry = list_entry(tmp, struct dentry, d_lru);
if (dentry->d_sb != sb)
continue;
list_move(tmp, &dentry_unused);
}
/*
* Pass two ... free the dentries for this superblock.
*/
repeat:
list_for_each_safe(tmp, next, &dentry_unused) {
dentry = list_entry(tmp, struct dentry, d_lru);
if (dentry->d_sb != sb)
continue;
dentry_stat.nr_unused--;
list_del_init(tmp);
spin_lock(&dentry->d_lock);
if (atomic_read(&dentry->d_count)) {
/*
* linux-2.6.20.7/fs/dcache.c
*
* ¥3
* how can i get dentry on lru later?
* where u go on earth?
*/
spin_unlock(&dentry->d_lock);
continue;
}
prune_one_dentry(dentry);
cond_resched_lock(&dcache_lock);
goto repeat;
}
spin_unlock(&dcache_lock);
}
原帖由 sisi8408 于 2007-8-24 11:22 发表
if (!error) {
d_delete(dentry);
/*
* d_delete return potentially without releasing dcache_lock & dentry->d_lock
*/
}
/*
* however dput at least try to ...
原帖由 思一克 于 2007-8-24 11:46 发表
你怎么知道d_delete return potentially without releasing dcache_lock & dentry->d_lock?
我看的是2。6。13版本。和你的应该差不多。
原帖由 sisi8408 于 2007-8-24 13:11 发表
如果skipjack用的版本疮上了,这里提个醒,不算太罗唆。
哪个版本稳定呐?不好说,看的人多一点,可能稍好吧。
BUG,俺叫他八哥,一种好听的鸟,养着乐的。
int tcp_set_allowed_congestion_control(char *val) { struct tcp_congestion_ops *ca; char *clone, *name; int ret = 0; clone = kstrdup(val, GFP_USER); if (!clone) return -ENOMEM; spin_lock(&tcp_cong_list_lock); /* pass 1 check for bad entries */ while ((name = strsep(&clone, " ")) && *name) { ca = tcp_ca_find(name); if (!ca) { ret = -ENOENT; goto out; } } /* pass 2 clear old values */ list_for_each_entry_rcu(ca, &tcp_cong_list, list) ca->flags &= ~TCP_CONG_NON_RESTRICTED; /* pass 3 mark as allowed */ while ((name = strsep(&val, " ")) && *name) { ca = tcp_ca_find(name); WARN_ON(!ca); if (ca) ca->flags |= TCP_CONG_NON_RESTRICTED; } out: spin_unlock(&tcp_cong_list_lock); return ret; } |
static void switch_names(struct dentry *dentry, struct dentry *target) { if (dname_external(target)) { if (dname_external(dentry)) { /* * Both external: swap the pointers */ do_switch(target->d_name.name, dentry->d_name.name); } else { /* * dentry:internal, target:external. Steal target's * storage and make target internal. */ memcpy(target->d_iname, dentry->d_name.name, dentry->d_name.len + 1); dentry->d_name.name = target->d_name.name; target->d_name.name = target->d_iname; } } else { if (dname_external(dentry)) { /* * dentry:external, target:internal. Give dentry's * storage to target and make dentry internal */ memcpy(dentry->d_iname, target->d_name.name, target->d_name.len + 1); target->d_name.name = dentry->d_name.name; dentry->d_name.name = dentry->d_iname; } else { /* * Both are internal. Just copy target to dentry */ memcpy(dentry->d_iname, target->d_name.name, target->d_name.len + 1); } } } |
int block_page_mkwrite(struct vm_area_struct *vma, struct page *page, get_block_t get_block) { struct inode *inode = vma->vm_file->f_path.dentry->d_inode; unsigned long end; loff_t size; int ret = -EINVAL; lock_page(page); size = i_size_read(inode); if ((page->mapping != inode->i_mapping) || (page_offset(page) > size)) { /* page got truncated out from underneath us */ goto out_unlock; } /* page is wholly or partially inside EOF */ if (((page->index + 1) << PAGE_CACHE_SHIFT) > size) end = size & ~PAGE_CACHE_MASK; else end = PAGE_CACHE_SIZE; ret = block_prepare_write(page, 0, end, get_block); if (!ret) ret = block_commit_write(page, 0, end); out_unlock: unlock_page(page); return ret; } |
欢迎光临 Chinaunix (http://bbs.chinaunix.net/) | Powered by Discuz! X3.2 |