linux-next: build failure after merge of the vfs tree
Subsystems (2)
Hi Al,
After merging the vfs tree, today's linux-next build (x86_64 allmodconfig) failed like this:
fs/orangefs/symlink.c:26:2: error: unknown field 'follow_link' specified in initializer
.follow_link = pvfs2_follow_link,
^fs/orangefs/symlink.c:26:17: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
.follow_link = pvfs2_follow_link,
^
fs/orangefs/symlink.c:26:17: note: (near initialization for 'pvfs2_symlink_inode_operations.put_link')
Caused by commit
6b2553918d8b ("replace ->follow_link() with new method that could stay in RCU mode")
[I wish there was some way to stage these API changes :-(]
I applied the following merge fix patch (which may need more work):
From: Stephen Rothwell <[email protected]>
Date: Thu, 10 Dec 2015 11:12:36 +1100
Subject: [PATCH] orangfs: update for follow_link to get_link change
--- fs/orangefs/symlink.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
fs/orangefs/symlink.c +9 -3
@@ -8,9 +8,15 @@#include "pvfs2-kernel.h" #include "pvfs2-bufmap.h" -static const char *pvfs2_follow_link (struct dentry *dentry,void **cookie) +static const char *pvfs2_get_link (struct dentry *dentry,struct inode *inode, +void **cookie) { -char *target =PVFS2_I (dentry->d_inode)->link_target; +char *target; + +if (!dentry) +return ERR_PTR (-ECHILD ); + + target =PVFS2_I (inode)->link_target; gossip_debug(GOSSIP_INODE_DEBUG, "%s: called on %s (target is %p)\n",
@@ -23,7 +29,7 @@ static const char *pvfs2_follow_link(struct dentry *dentry, void **cookie)struct inode_operations pvfs2_symlink_inode_operations = { .readlink = generic_readlink, - .follow_link = pvfs2_follow_link, + .get_link = pvfs2_get_link, .setattr = pvfs2_setattr, .getattr = pvfs2_getattr, .listxattr = pvfs2_listxattr,
Signature · 5 lines
2.6.2 -- Cheers, Stephen Rothwell [email protected]
[Just adding the origefs maintainer to the cc list]
Quoted 64 lines · On Thu, 10 Dec 2015 11:18:47 +1100 Stephen Rothwell <[email protected]>…
Hi Al,
After merging the vfs tree, today's linux-next build (
x86_64allmodconfig) failed like this:
fs/orangefs/symlink.c:26:2: error: unknown field 'follow_link' specified in initializer
.follow_link =pvfs2_follow_link,
^fs/orangefs/symlink.c:26:17: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
.follow_link =pvfs2_follow_link,^
fs/orangefs/symlink.c:26:17: note: (near initialization for 'pvfs2_symlink_inode_operations.put_link')Caused by commit
6b2553918d8b("replace ->follow_link() with new method that could stay in RCU mode")[I wish there was some way to stage these API changes :-(]
I applied the following merge fix patch (which may need more work):
From: Stephen Rothwell <[email protected]>
Date: Thu, 10 Dec 2015 11:12:36 +1100
Subject: [PATCH] orangfs: update forfollow_linktoget_linkchangeSigned-off-by Stephen Rothwell <[email protected]>--- fs/orangefs/symlink.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)fs/orangefs/symlink.c +9
-3@@ -8,9 +8,15 @@#include "pvfs2-kernel.h" #include "pvfs2-bufmap.h" -static const char *pvfs2_follow_link (struct dentry *dentry,void **cookie) +static const char *pvfs2_get_link (struct dentry *dentry,struct inode *inode, +void **cookie) { -char *target =PVFS2_I (dentry->d_inode)->link_target; +char *target; + +if (!dentry) +return ERR_PTR (-ECHILD ); + + target =PVFS2_I (inode)->link_target; gossip_debug(GOSSIP_INODE_DEBUG, "%s: called on %s (target is %p)\n",@@ -23,7 +29,7 @@ static const char *pvfs2_follow_link(struct dentry *dentry, void **cookie)struct inode_operations pvfs2_symlink_inode_operations = { .readlink = generic_readlink, - .follow_link = pvfs2_follow_link, + .get_link = pvfs2_get_link, .setattr = pvfs2_setattr, .getattr = pvfs2_getattr, .listxattr = pvfs2_listxattr,Signature · 1 line
2.6.2
Signature · 2 lines
Cheers, Stephen Rothwell [email protected]
Quoted 6 lines · Stephen Rothwell
[Just adding the origefs maintainer to the cc list]
fs/orangefs/symlink.c line 13
Quoted 5 lines
fs/orangefs/symlink.c +2
-2-static const char *pvfs2_follow_link (struct dentry *dentry,void **cookie) +static const char *pvfs2_get_link (struct dentry *dentry,struct inode *inode, +void **cookie) { -char *target =PVFS2_I (dentry->d_inode)->link_target;
Better fix is to have inode->link = PVFS2_I(dentry->d_inode)->link_target; when we set the latter and use .get_link = simple_get_link...
Said that, there is an unpleasant bug in that area - link_target of a live inode can be overwritten, right under the pathname resolution walking the old contents of that thing.
copy_attributes_to_inode() is triggered by ->d_revalidate() and by ->getattr() and it's really, really unsafe for a live inode. Just look what it does to ->i_mode... Sure, normally a server won't return different symlink bodies on subsequent getattr requests. As long as it's sane (and not compromised, etc.), but relying upon that is not a good idea.
Mike Marshall
maintainerQuoted 3 lines
Said that, there is an unpleasant bug in that area -
link_targetof a live inode can be overwritten, right under the pathname resolution walking the old contents of that thing
Figuring that out is on the list. This week I've been working on cleaning up orangefs_devreq_writev, and Martin even has a version that changes the protocol where userspace uses write instead of writev, getting rid of the 4-or-5 iovec scheme Al hates. If he still hates it after the code is readable, we'll probably go that direction...
And we have an infant fuzzer that we've already crashed the kernel with (and made an easy and good fix, I think).
And also this week I have tried to address Linus' concerns about our old fashioned waiting scheme where we used add_wait_queue and set_current_state instead of the wait_event() model.
Yi Liu who is also working with us on this project has provided a patch that changes all the pvfs2 occurrences to orangefs.
These patches will be in our kernel.org tree very soon I hope, but we won't be done yet...
-Mike "you're never done..."
Quoted 20 lines · Al Viro
Quoted 6 lines · Stephen Rothwell
[Just adding the origefs maintainer to the cc list]
fs/orangefs/symlink.c line 13
Quoted 5 lines
fs/orangefs/symlink.c +2
-2-static const char *pvfs2_follow_link (struct dentry *dentry,void **cookie) +static const char *pvfs2_get_link (struct dentry *dentry,struct inode *inode, +void **cookie) { -char *target =PVFS2_I (dentry->d_inode)->link_target;Better fix is to have
inode->link= PVFS2_I(dentry->d_inode)->link_target; when we set the latter and use .get_link =simple_get_link...Said that, there is an unpleasant bug in that area -
link_targetof a live inode can be overwritten, right under the pathname resolution walking the old contents of that thing.
copy_attributes_to_inode()is triggered by ->d_revalidate() and by ->getattr() and it's really, really unsafe for a live inode. Just look what it does to ->i_mode... Sure, normally a server won't return different symlink bodies on subsequent getattr requests. As long as it's sane (and not compromised, etc.), but relying upon that is not a good idea.
Hi Stephen,
Quoted 54 lines · On Thu, 10 Dec 2015 11:18:47 +1100 Stephen Rothwell <[email protected]>…
Hi Al,
After merging the vfs tree, today's linux-next build (
x86_64allmodconfig) failed like this:
fs/orangefs/symlink.c:26:2: error: unknown field 'follow_link' specified in initializer
.follow_link =pvfs2_follow_link,
^fs/orangefs/symlink.c:26:17: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
.follow_link =pvfs2_follow_link,^
fs/orangefs/symlink.c:26:17: note: (near initialization for 'pvfs2_symlink_inode_operations.put_link')Caused by commit
6b2553918d8b("replace ->follow_link() with new method that could stay in RCU mode")[I wish there was some way to stage these API changes :-(]
I applied the following merge fix patch (which may need more work):
From: Stephen Rothwell <[email protected]>
Date: Thu, 10 Dec 2015 11:12:36 +1100
Subject: [PATCH] orangfs: update forfollow_linktoget_linkchangeSigned-off-by Stephen Rothwell <[email protected]>--- fs/orangefs/symlink.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)fs/orangefs/symlink.c +8
-2@@ -8,9 +8,15 @@#include "pvfs2-kernel.h" #include "pvfs2-bufmap.h" -static const char *pvfs2_follow_link (struct dentry *dentry,void **cookie) +static const char *pvfs2_get_link (struct dentry *dentry,struct inode *inode, +void **cookie) { -char *target =PVFS2_I (dentry->d_inode)->link_target; +char *target; + +if (!dentry) +return ERR_PTR (-ECHILD ); + + target =PVFS2_I (inode)->link_target; gossip_debug(GOSSIP_INODE_DEBUG, "%s: called on %s (target is %p)\n",
fs/orangefs/symlink.c static const char *pvfs2_follow_link(struct dentry *dentry, void **cookie) · line 35
Quoted 8 lines
fs/orangefs/symlink.c +1
-1@@ -23,7 +29,7 @@ static const char *pvfs2_follow_link(struct dentry *dentry, void **cookie)struct inode_operations pvfs2_symlink_inode_operations = { .readlink = generic_readlink, - .follow_link = pvfs2_follow_link, + .get_link = pvfs2_get_link, .setattr = pvfs2_setattr, .getattr = pvfs2_getattr, .listxattr = pvfs2_listxattr,
This patch now looks like this (after changes to the orangefs tree):
fs/orangefs/symlink.c +9 -3
@@ -8,9 +8,15 @@#include "orangefs-kernel.h" #include "orangefs-bufmap.h" -static const char *orangefs_follow_link (struct dentry *dentry,void **cookie) +static const char *orangefs_get_link (struct dentry *dentry,struct inode *inode, +void **cookie) { -char *target =ORANGEFS_I (dentry->d_inode)->link_target; +char *target; + +if (!dentry) +return ERR_PTR (-ECHILD ); + + target =ORANGEFS_I (inode)->link_target; gossip_debug(GOSSIP_INODE_DEBUG, "%s: called on %s (target is %p)\n",
@@ -23,7 +29,7 @@ static const char *orangefs_follow_link(struct dentry *dentry, void **cookie)struct inode_operations orangefs_symlink_inode_operations = { .readlink = generic_readlink, - .follow_link = orangefs_follow_link, + .get_link = orangefs_get_link, .setattr = orangefs_setattr, .getattr = orangefs_getattr, .listxattr = orangefs_listxattr,
Signature · 2 lines
Cheers, Stephen Rothwell [email protected]
Hi all,
Quoted 88 lines · On Mon, 21 Dec 2015 11:23:01 +1100 Stephen Rothwell <[email protected]>…
Quoted 52 lines · On Thu, 10 Dec 2015 11:18:47 +1100 Stephen Rothwell <[email protected]>…
After merging the vfs tree, today's linux-next build (
x86_64allmodconfig) failed like this:
fs/orangefs/symlink.c:26:2: error: unknown field 'follow_link' specified in initializer
.follow_link =pvfs2_follow_link,
^fs/orangefs/symlink.c:26:17: warning: initialization from incompatible pointer type [-Wincompatible-pointer-types]
.follow_link =pvfs2_follow_link,^
fs/orangefs/symlink.c:26:17: note: (near initialization for 'pvfs2_symlink_inode_operations.put_link')Caused by commit
6b2553918d8b("replace ->follow_link() with new method that could stay in RCU mode")[I wish there was some way to stage these API changes :-(]
I applied the following merge fix patch (which may need more work):
From: Stephen Rothwell <[email protected]>
Date: Thu, 10 Dec 2015 11:12:36 +1100
Subject: [PATCH] orangfs: update forfollow_linktoget_linkchangeSigned-off-by Stephen Rothwell <[email protected]>--- fs/orangefs/symlink.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)fs/orangefs/symlink.c +8
-2@@ -8,9 +8,15 @@#include "pvfs2-kernel.h" #include "pvfs2-bufmap.h" -static const char *pvfs2_follow_link (struct dentry *dentry,void **cookie) +static const char *pvfs2_get_link (struct dentry *dentry,struct inode *inode, +void **cookie) { -char *target =PVFS2_I (dentry->d_inode)->link_target; +char *target; + +if (!dentry) +return ERR_PTR (-ECHILD ); + + target =PVFS2_I (inode)->link_target; gossip_debug(GOSSIP_INODE_DEBUG, "%s: called on %s (target is %p)\n",fs/orangefs/symlink.c static const char *pvfs2_follow_link(struct dentry *dentry, void **cookie) · line 35
Quoted 8 lines
fs/orangefs/symlink.c +1
-1@@ -23,7 +29,7 @@ static const char *pvfs2_follow_link(struct dentry *dentry, void **cookie)struct inode_operations pvfs2_symlink_inode_operations = { .readlink = generic_readlink, - .follow_link = pvfs2_follow_link, + .get_link = pvfs2_get_link, .setattr = pvfs2_setattr, .getattr = pvfs2_getattr, .listxattr = pvfs2_listxattr,This patch now looks like this (after changes to the orangefs tree):
fs/orangefs/symlink.c +8
-2@@ -8,9 +8,15 @@#include "orangefs-kernel.h" #include "orangefs-bufmap.h" -static const char *orangefs_follow_link (struct dentry *dentry,void **cookie) +static const char *orangefs_get_link (struct dentry *dentry,struct inode *inode, +void **cookie) { -char *target =ORANGEFS_I (dentry->d_inode)->link_target; +char *target; + +if (!dentry) +return ERR_PTR (-ECHILD ); + + target =ORANGEFS_I (inode)->link_target; gossip_debug(GOSSIP_INODE_DEBUG, "%s: called on %s (target is %p)\n",
fs/orangefs/symlink.c static const char *orangefs_follow_link(struct dentry *dentry, void **cookie) · line 35
Quoted 8 lines
fs/orangefs/symlink.c +1
-1@@ -23,7 +29,7 @@ static const char *orangefs_follow_link(struct dentry *dentry, void **cookie)struct inode_operations orangefs_symlink_inode_operations = { .readlink = generic_readlink, - .follow_link = orangefs_follow_link, + .get_link = orangefs_get_link, .setattr = orangefs_setattr, .getattr = orangefs_getattr, .listxattr = orangefs_listxattr,
This patch now looks like this (I think this is right):
From: Stephen Rothwell <[email protected]>
Date: Thu, 7 Jan 2016 11:37:17 +1100
Subject: [PATCH] orangfs: update for follow_link to get_link change
--- fs/orangefs/symlink.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
fs/orangefs/symlink.c +9 -5
@@ -8,22 +8,26 @@#include "orangefs-kernel.h" #include "orangefs-bufmap.h" -static const char *orangefs_follow_link (struct dentry *dentry,void **cookie) +static const char *orangefs_get_link (struct dentry *dentry,struct inode *inode, +struct delayed_call *done) { -char *target =ORANGEFS_I (dentry->d_inode)->link_target; +char *target; + +if (!dentry) +return ERR_PTR (-ECHILD ); + + target =ORANGEFS_I (dentry->d_inode)->link_target;gossip_debug (GOSSIP_INODE_DEBUG ,"%s: called on %s (target is %p)\n" , __func__, (char *)dentry->d_name.name, target); - *cookie = target; -return target; }struct inode_operations orangefs_symlink_inode_operations = { .readlink = generic_readlink, - .follow_link = orangefs_follow_link, + .get_link = orangefs_get_link, .setattr = orangefs_setattr, .getattr = orangefs_getattr, .listxattr = orangefs_listxattr,
Signature · 5 lines
2.6.4 -- Cheers, Stephen Rothwell [email protected]
Quoted 2 lines · Stephen Rothwell
Quoted 2 lines
This patch now looks like this (after changes to the orangefs tree):
Guys, just set inode->i_link to ORANGEFS_I(dentry->d_inode)->link_target and have ->get_link = simple_get_link. Killing orangefs_{follow,get}_link() entirely.