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:	Tue, 5 Dec 2006 22:17:14 +0100 (MET)
From:	Jan Engelhardt <jengelh@...ux01.gwdg.de>
To:	"Josef 'Jeff' Sipek" <jsipek@...sunysb.edu>
cc:	linux-kernel@...r.kernel.org, torvalds@...l.org, akpm@...l.org,
	hch@...radead.org, viro@....linux.org.uk,
	linux-fsdevel@...r.kernel.org, mhalcrow@...ibm.com
Subject: Re: [PATCH 19/35] Unionfs: Directory file operations



>+++ b/fs/unionfs/dirfops.c

>+/* This is not meant to be a generic repositioning function.  If you do
>+ * things that aren't supported, then we return EINVAL.
>+ *
>+ * What is allowed:
>+ *  (1) seeking to the same position that you are currently at
>+ *	This really has no effect, but returns where you are.
>+ *  (2) seeking to the end of the file, if you've read everything
>+ *	This really has no effect, but returns where you are.
>+ *  (3) seeking to the beginning of the file
>+ *	This throws out all state, and lets you begin again.
>+ */
>+static loff_t unionfs_dir_llseek(struct file *file, loff_t offset, int origin)
>+{
[...]
>+	/* We let users seek to their current position, but not anywhere else. */
>+	if (!offset) {
[...]
>+		case SEEK_END:
>+			/* Unsupported, because we would break everything.  */
>+			err = -EINVAL;
>+			break;
[...]

This SEEK_END implementation clashes with (2).

>+	} else {
[...]
>+	}
>+
>+out:
>+	return err;
>+}
>+
>+/* Trimmed directory options, we shouldn't pass everything down since
>+ * we don't want to operate on partial directories.
>+ */
>+struct file_operations unionfs_dir_fops = {
>+	.llseek =		unionfs_dir_llseek,
>+	.read =			generic_read_dir,
>+	.readdir =		unionfs_readdir,
>+	.unlocked_ioctl =	unionfs_ioctl,
>+	.open =			unionfs_open,
>+	.release =		unionfs_file_release,
>+	.flush =		unionfs_flush,
>+};

Prefers

+struct file_operations unionfs_dir_fops = {
+	.llseek         = unionfs_dir_llseek,
+	.read           = generic_read_dir,
+	.readdir        = unionfs_readdir,
+	.unlocked_ioctl = unionfs_ioctl,
+	.open           = unionfs_open,
+	.release        = unionfs_file_release,
+	.flush          = unionfs_flush,
+};

BTW, you could line up other structs too! :)



	-`J'
-- 
-
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