public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Louis Rilling <Louis.Rilling@kerlabs.com>
To: Joel.Becker@oracle.com
Cc: Louis.Rilling@kerlabs.com, ocfs2-devel@oss.oracle.com,
	linux-kernel@vger.kernel.org
Subject: [RFC][PATCH 2/3] configfs: call drop_link() to cleanup after create_link() failure
Date: Thu, 12 Jun 2008 17:26:47 +0200	[thread overview]
Message-ID: <20080612152953.667564205@kerlabs.com> (raw)
In-Reply-To: 20080612152645.445504681@kerlabs.com

[-- Attachment #1: configfs-drop_link-if-create_link-fails.patch --]
[-- Type: text/plain, Size: 1126 bytes --]

When allow_link() succeeds but create_link() fails, the subsystem is not
informed of the failure.

This patch fixes this by calling drop_link() on create_link() failures.

Signed-off-by: Louis Rilling <Louis.Rilling@kerlabs.com>
---
 fs/configfs/symlink.c |    6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Index: b/fs/configfs/symlink.c
===================================================================
--- a/fs/configfs/symlink.c	2008-06-12 17:13:27.000000000 +0200
+++ b/fs/configfs/symlink.c	2008-06-12 17:13:38.000000000 +0200
@@ -137,8 +137,12 @@ int configfs_symlink(struct inode *dir, 
 		goto out_put;
 
 	ret = type->ct_item_ops->allow_link(parent_item, target_item);
-	if (!ret)
+	if (!ret) {
 		ret = create_link(parent_item, target_item, dentry);
+		if (ret && type->ct_item_ops->drop_link)
+			type->ct_item_ops->drop_link(parent_item,
+						     target_item);
+	}
 
 	config_item_put(target_item);
 	path_put(&nd.path);

-- 
Dr Louis Rilling			Kerlabs
Skype: louis.rilling			Batiment Germanium
Phone: (+33|0) 6 80 89 08 23		80 avenue des Buttes de Coesmes
http://www.kerlabs.com/			35700 Rennes


  parent reply	other threads:[~2008-06-12 15:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-12 15:26 [RFC][PATCH 0/3] configfs: Miscellaneous fixes Louis Rilling
2008-06-12 15:26 ` [RFC][PATCH 1/3] configfs: Report errors in config_*_init_type_name() Louis Rilling
2008-06-12 18:42   ` Joel Becker
2008-06-12 15:26 ` Louis Rilling [this message]
2008-06-12 18:45   ` [RFC][PATCH 2/3] configfs: call drop_link() to cleanup after create_link() failure Joel Becker
2008-06-12 15:26 ` [RFC][PATCH 3/3] configfs: Protect configfs_dirent s_links list mutations Louis Rilling

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20080612152953.667564205@kerlabs.com \
    --to=louis.rilling@kerlabs.com \
    --cc=Joel.Becker@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox