lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 4 Sep 2006 14:20:43 +0300
From:	"Pekka Enberg" <penberg@...helsinki.fi>
To:	"Josef Sipek" <jsipek@...sunysb.edu>
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	hch@...radead.org, akpm@...l.org, viro@....linux.org.uk
Subject: Re: [PATCH 03/22][RFC] Unionfs: Branch management functionality

On 9/1/06, Josef Sipek <jsipek@...sunysb.edu> wrote:
> +struct dentry **alloc_new_dentries(int objs)
> +{
> +       if (!objs)
> +               return NULL;
> +
> +       return kzalloc(sizeof(struct dentry *) * objs, GFP_KERNEL);

kcalloc

> +struct unionfs_usi_data *alloc_new_data(int objs)
> +{
> +       if (!objs)
> +               return NULL;
> +
> +       return kzalloc(sizeof(struct unionfs_usi_data) * objs, GFP_KERNEL);
> +}

Same here. I suggest you kill the wrappers too.

> +int unionfs_ioctl_incgen(struct file *file, unsigned int cmd, unsigned long arg)
> +{
> +       struct super_block *sb;
> +       int gen;
> +
> +       sb = file->f_dentry->d_sb;
> +
> +       unionfs_write_lock(sb);
> +
> +       atomic_inc(&stopd(sb)->usi_generation);
> +       gen = atomic_read(&stopd(sb)->usi_generation);

You could use atomic_inc_return here. Is usi_generation protected by
write lock on sb or do you really need atomic ops?

> +
> +       atomic_set(&dtopd(sb->s_root)->udi_generation, gen);
> +       atomic_set(&itopd(sb->s_root->d_inode)->uii_generation, gen);
> +
> +       unionfs_write_unlock(sb);
> +
> +       return gen;
> +}

-- 
VGER BF report: U 0.5
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ