Skip to contentSkip to conversation

ocfs2 and configfs fixes

PATCH New Mark Fasheh 1 participant 1 message Oct 20, 2006

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ocfs2 and configfs fixes

Just a small set of fixes this time.

Please pull from 'upstream-linus' branch of
git://git.kernel.org/pub/scm/linux/kernel/git/mfasheh/ocfs2.git upstream-linus

to receive the following updates:

 fs/configfs/file.c             |   14 ++++++-----
 fs/ocfs2/cluster/nodemanager.c |   10 ++++----
 fs/ocfs2/file.c                |   51 ++++++++++++++++++++++++-----------------
 fs/ocfs2/namei.c               |    8 ------
 4 files changed, 45 insertions(+), 38 deletions(-)

Akinobu Mita:
ocfs2: delete redundant memcmp()

Chandra Seetharaman:
configfs: handle kzalloc() failure in check_perm()

Mark Fasheh:
ocfs2: fix page zeroing during simple extends
ocfs2: cond_resched() in ocfs2_zero_extend()

Sunil Mushran:
ocfs2: remove spurious d_count check in ocfs2_rename()

fs/configfs/file.c +8 -6
index e6d5754..cf33fac 100644
@@ -275,13 +275,14 @@ static int check_perm(struct inode * ino
 	 * it in file->private_data for easy access.
 	 */
 	buffer = kzalloc(sizeof(struct configfs_buffer),GFP_KERNEL);
-	if (buffer) {
-		init_MUTEX(&buffer->sem);
-		buffer->needs_read_fill = 1;
-		buffer->ops = ops;
-		file->private_data = buffer;
-	} else
+	if (!buffer) {
 		error = -ENOMEM;
+		goto Enomem;
+	}
+	init_MUTEX(&buffer->sem);
+	buffer->needs_read_fill = 1;
+	buffer->ops = ops;
+	file->private_data = buffer;
 	goto Done;
 
  Einval:
@@ -289,6 +290,7 @@ static int check_perm(struct inode * ino
 	goto Done;
  Eaccess:
 	error = -EACCES;
+ Enomem:
 	module_put(attr->ca_owner);
  Done:
 	if (error && item)
fs/ocfs2/cluster/nodemanager.c +6 -4
index e1fceb8..d11753c 100644
@@ -152,14 +152,16 @@ static struct o2nm_node *o2nm_node_ip_tr
 	struct o2nm_node *node, *ret = NULL;
 
 	while (*p) {
+		int cmp;
+
 		parent = *p;
 		node = rb_entry(parent, struct o2nm_node, nd_ip_node);
 
-		if (memcmp(&ip_needle, &node->nd_ipv4_address,
-		           sizeof(ip_needle)) < 0)
+		cmp = memcmp(&ip_needle, &node->nd_ipv4_address,
+				sizeof(ip_needle));
+		if (cmp < 0)
 			p = &(*p)->rb_left;
-		else if (memcmp(&ip_needle, &node->nd_ipv4_address,
-			        sizeof(ip_needle)) > 0)
+		else if (cmp > 0)
 			p = &(*p)->rb_right;
 		else {
 			ret = node;
fs/ocfs2/file.c +31 -20

82 lines not on this page · raw message

fs/ocfs2/namei.c +0 -8
index 259155f..a57b751 100644
@@ -1085,14 +1085,6 @@ static int ocfs2_rename(struct inode *ol
 			BUG();
 	}
 
-	if (atomic_read(&old_dentry->d_count) > 2) {
-		shrink_dcache_parent(old_dentry);
-		if (atomic_read(&old_dentry->d_count) > 2) {
-			status = -EBUSY;
-			goto bail;
-		}
-	}
-
 	/* Assume a directory heirarchy thusly:
 	 * a/b/c
 	 * a/d