From: Jan Kara <jack@suse.cz>
To: Al Viro <viro@ZenIV.linux.org.uk>
Cc: linux-fsdevel@vger.kernel.org,
Boaz Harrosh <bharrosh@panasas.com>, Jan Kara <jack@suse.cz>
Subject: [PATCH 5/5] exofs: Handle error from d_splice_alias()
Date: Wed, 20 Jun 2012 22:58:40 +0200 [thread overview]
Message-ID: <1340225920-29379-5-git-send-email-jack@suse.cz> (raw)
In-Reply-To: <1340225920-29379-1-git-send-email-jack@suse.cz>
From: Boaz Harrosh <bharrosh@panasas.com>
When directory hierarchy is corrupted and contains cycles, d_splice_alias() can
fail. Warn user if that happens.
Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
Signed-off-by: Jan Kara <jack@suse.cz>
---
fs/exofs/namei.c | 6 +++++-
1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/fs/exofs/namei.c b/fs/exofs/namei.c
index fc7161d..6f44d3c 100644
--- a/fs/exofs/namei.c
+++ b/fs/exofs/namei.c
@@ -50,13 +50,17 @@ static struct dentry *exofs_lookup(struct inode *dir, struct dentry *dentry,
{
struct inode *inode;
ino_t ino;
+ struct dentry *ret;
if (dentry->d_name.len > EXOFS_NAME_LEN)
return ERR_PTR(-ENAMETOOLONG);
ino = exofs_inode_by_name(dir, dentry);
inode = ino ? exofs_iget(dir->i_sb, ino) : NULL;
- return d_splice_alias(inode, dentry);
+ ret = d_splice_alias(inode, dentry);
+ if (IS_ERR(ret))
+ EXOFS_ERR("directory #%lu corrupted", dir->i_ino);
+ return ret;
}
static int exofs_create(struct inode *dir, struct dentry *dentry, umode_t mode,
--
1.7.1
next prev parent reply other threads:[~2012-06-20 20:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-20 20:58 [PATCH 1/5 v2] vfs: Avoid creation of directory loops for corrupted filesystems Jan Kara
2012-06-20 20:58 ` [PATCH 2/5] ext2: Handle error from d_splice_alias() Jan Kara
2012-06-20 20:58 ` [PATCH 3/5] ext3: " Jan Kara
2012-06-20 20:58 ` [PATCH 4/5] ext4: " Jan Kara
2012-06-20 20:58 ` Jan Kara [this message]
2012-06-28 8:30 ` [PATCH 1/5 v2] vfs: Avoid creation of directory loops for corrupted filesystems Jan Kara
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=1340225920-29379-5-git-send-email-jack@suse.cz \
--to=jack@suse.cz \
--cc=bharrosh@panasas.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/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;
as well as URLs for NNTP newsgroup(s).