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]
Message-ID: <Pine.LNX.4.61.0609040852550.9108@yvahk01.tjqt.qr>
Date:	Mon, 4 Sep 2006 08:59:08 +0200 (MEST)
From:	Jan Engelhardt <jengelh@...ux01.gwdg.de>
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 05/22][RFC] Unionfs: Copyup Functionality


>+/* Determine the mode based on the copyup flags, and the existing dentry. */
>+static int copyup_permissions(struct super_block *sb,
>+			      struct dentry *old_hidden_dentry,
>+			      struct dentry *new_hidden_dentry)
>+{
>+	struct iattr newattrs;
>+	int err;
>+
>+	newattrs.ia_atime = old_hidden_dentry->d_inode->i_atime;
>+	newattrs.ia_mtime = old_hidden_dentry->d_inode->i_mtime;
>+	newattrs.ia_ctime = old_hidden_dentry->d_inode->i_ctime;

How about,

	struct inode *ohi = old_hidden_dentry->d_inode;
	newattrs.ia_atime = ohi->i_atime;

reduces typing a little.

>+	if (S_ISDIR(old_mode)) {
>+		args.u.mkdir.parent = new_hidden_parent_dentry->d_inode;
>+		args.u.mkdir.dentry = new_hidden_dentry;
>+		args.u.mkdir.mode = old_mode;

Like above maybe?

>+	} else {
>+		printk(KERN_ERR "Unknown inode type %d\n",
>+				old_mode);
>+		BUG();
>+	}

Is BUG the right thing, what do others think? (Using WARN, and set err to
something useful?)

>+	} while ((read_bytes > 0) && (len > 0));

-()

>+/* This function creates a copy of a file represented by 'file' which currently
>+ * resides in branch 'bstart' to branch 'new_bindex.
                                                     ^

+'

>+struct dentry *create_parents(struct inode *dir, struct dentry *dentry,
>+			      int bindex)
>+{
>+	struct dentry *hidden_dentry;
>+
>+	hidden_dentry =
>+	    create_parents_named(dir, dentry, dentry->d_name.name, bindex);
>+
>+	return (hidden_dentry);
>+}

{
	return create_parents_named(dir, dentry, dentry->d_name.name, bindex);
}


>+struct dentry *create_parents_named(struct inode *dir, struct dentry *dentry,
>+				    const char *name, int bindex)
>+{
>+	struct dentry **path = NULL;
>+	path = (struct dentry **)kzalloc(kmalloc_size, GFP_KERNEL);

Nocast.

>+	if (!path)
>+		;

Woha?!

>+			tmp_path =
>+			    (struct dentry **)kzalloc(kmalloc_size, GFP_KERNEL);

Nocast.



Jan Engelhardt
-- 

-- 
VGER BF report: H 0
-
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