diff options
author | J. Bruce Fields <bfields@fieldses.org> | 2014-01-16 13:51:07 -0500 |
---|---|---|
committer | Steven Whitehouse <swhiteho@redhat.com> | 2014-01-18 04:50:53 -0500 |
commit | d57b9c9a999a8f4475fe73fba629c964245800ca (patch) | |
tree | 70f6d70100cdbcf9590a3383c240606f6481e47b /fs/gfs2 | |
parent | 8b127d0494890ced4e35fb8eca6d6b57564ee1c6 (diff) |
GFS2: revert "GFS2: d_splice_alias() can't return error"
0d0d110720d7960b77c03c9f2597faaff4b484ae asserts that "d_splice_alias()
can't return error unless it was given an IS_ERR(inode)".
That was true of the implementation of d_splice_alias, but this is
really a problem with d_splice_alias: at a minimum it should be able to
return -ELOOP in the case where inserting the given dentry would cause a
directory loop.
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
Diffstat (limited to 'fs/gfs2')
-rw-r--r-- | fs/gfs2/inode.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/fs/gfs2/inode.c b/fs/gfs2/inode.c index b8956f24e3d3..890588c7fb33 100644 --- a/fs/gfs2/inode.c +++ b/fs/gfs2/inode.c | |||
@@ -604,6 +604,9 @@ static int gfs2_create_inode(struct inode *dir, struct dentry *dentry, | |||
604 | error = PTR_ERR(inode); | 604 | error = PTR_ERR(inode); |
605 | if (!IS_ERR(inode)) { | 605 | if (!IS_ERR(inode)) { |
606 | d = d_splice_alias(inode, dentry); | 606 | d = d_splice_alias(inode, dentry); |
607 | error = PTR_ERR(d); | ||
608 | if (IS_ERR(d)) | ||
609 | goto fail_gunlock; | ||
607 | error = 0; | 610 | error = 0; |
608 | if (file) { | 611 | if (file) { |
609 | if (S_ISREG(inode->i_mode)) { | 612 | if (S_ISREG(inode->i_mode)) { |
@@ -799,6 +802,11 @@ static struct dentry *__gfs2_lookup(struct inode *dir, struct dentry *dentry, | |||
799 | } | 802 | } |
800 | 803 | ||
801 | d = d_splice_alias(inode, dentry); | 804 | d = d_splice_alias(inode, dentry); |
805 | if (IS_ERR(d)) { | ||
806 | iput(inode); | ||
807 | gfs2_glock_dq_uninit(&gh); | ||
808 | return d; | ||
809 | } | ||
802 | if (file && S_ISREG(inode->i_mode)) | 810 | if (file && S_ISREG(inode->i_mode)) |
803 | error = finish_open(file, dentry, gfs2_open_common, opened); | 811 | error = finish_open(file, dentry, gfs2_open_common, opened); |
804 | 812 | ||