From: Nathan Scott <nathans@sgi.com>
To: Jens Axboe <axboe@suse.de>, Tom Zanussi <zanussi@us.ibm.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] blk queue io tracing support
Date: Wed, 31 Aug 2005 09:58:24 +1000 [thread overview]
Message-ID: <20050830235824.GG780@frodo> (raw)
In-Reply-To: <20050830234823.GF780@frodo>
Hi there,
On Wed, Aug 31, 2005 at 09:48:23AM +1000, Nathan Scott wrote:
> ...
> # find /relay
> /relay
> /relay/block
> /relay/block/sdd
> /relay/block/sdd/trace3
> /relay/block/sdd/trace2
> /relay/block/sdd/trace1
> /relay/block/sdd/trace0
> /relay/block/sdb
> /relay/block/sdb/trace3
> /relay/block/sdb/trace2
> /relay/block/sdb/trace1
> /relay/block/sdb/trace0
>
> and does the correct dynamic setup and teardown of the hierarchy
> as the userspace tool starts and stops tracing. I had to modify
> the relayfs rmdir code a bit to make this work properly, I'll
> send a separate patch for that shortly.
Here it is. The problem was that relayfs is allowing a directory
with children to be removed rather than returning -ENOTEMPTY. It
looks like this can be resolved by splitting the shared relayfs
unlink code (which is using simple_unlink) into separate file/dir
variants, one using simple_unlink, the other using simple_rmdir.
cheers.
--
Nathan
Index: 2.6.x-xfs/fs/relayfs/inode.c
===================================================================
--- 2.6.x-xfs.orig/fs/relayfs/inode.c
+++ 2.6.x-xfs/fs/relayfs/inode.c
@@ -187,8 +187,8 @@ struct dentry *relayfs_create_dir(const
}
/**
- * relayfs_remove - remove a file or directory in the relay filesystem
- * @dentry: file or directory dentry
+ * relayfs_remove - remove a file in the relay filesystem
+ * @dentry: file dentry
*/
int relayfs_remove(struct dentry *dentry)
{
@@ -219,10 +219,31 @@ int relayfs_remove(struct dentry *dentry
*/
int relayfs_remove_dir(struct dentry *dentry)
{
+ struct dentry *parent;
+ int error = 0;
+
if (!dentry)
return -EINVAL;
+ parent = dentry->d_parent;
+ if (!parent)
+ return -EINVAL;
+
+ parent = dget(parent);
+ down(&parent->d_inode->i_sem);
+ if (dentry->d_inode) {
+ error = simple_rmdir(parent->d_inode, dentry);
+ if (!error)
+ d_delete(dentry);
+ }
+ if (!error)
+ dput(dentry);
+ up(&parent->d_inode->i_sem);
+ dput(parent);
+
+ if (!error)
+ simple_release_fs(&relayfs_mount, &relayfs_mount_count);
- return relayfs_remove(dentry);
+ return error;
}
/**
next prev parent reply other threads:[~2005-08-31 0:06 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-08-23 12:32 [PATCH] blk queue io tracing support Jens Axboe
2005-08-24 1:03 ` Nathan Scott
2005-08-24 7:08 ` Jens Axboe
2005-08-24 7:19 ` Nathan Scott
2005-08-24 7:25 ` Jens Axboe
2005-08-24 9:28 ` Jens Axboe
2005-08-29 4:53 ` Nathan Scott
2005-08-29 5:57 ` Jens Axboe
2005-08-30 23:43 ` Nathan Scott
2005-08-31 7:31 ` Jens Axboe
2005-08-30 23:48 ` Nathan Scott
2005-08-30 23:58 ` Nathan Scott [this message]
2005-08-31 4:19 ` Tom Zanussi
2005-08-31 4:33 ` Nathan Scott
2005-08-31 4:53 ` Nathan Scott
2005-08-31 4:55 ` Tom Zanussi
2005-08-31 7:33 ` Jens Axboe
2005-09-02 11:20 ` Jens Axboe
2005-08-24 6:24 ` Nathan Scott
2005-08-24 7:08 ` Jens Axboe
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=20050830235824.GG780@frodo \
--to=nathans@sgi.com \
--cc=axboe@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=zanussi@us.ibm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.