From: Edward Shishkin <edward.shishkin@gmail.com>
To: Reiserfs development mailing list <reiserfs-devel@vger.kernel.org>
Subject: [PATCH] reiser4: port for Linux-4.5
Date: Wed, 30 Mar 2016 11:20:23 +0200 [thread overview]
Message-ID: <56FB9A57.3040906@gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 270 bytes --]
. Adjust for the new ->get_link() of vfs's inode_operations: we don't
support RCU mode;
. check returned value of __copy_from_user() to make gcc happy
(the path is never invoked) in create_item_node40().
Signed-off-by: Edward Shishkin <edward.shishkin@gmail.com>
[-- Attachment #2: reiser4-port-for-4.5.patch --]
[-- Type: text/x-patch, Size: 3721 bytes --]
diff -u -r linux-4.4/fs/reiser4/plugin/inode_ops.c linux-4.5/fs/reiser4/plugin/inode_ops.c
--- linux-4.4/fs/reiser4/plugin/inode_ops.c 2016-03-30 11:00:02.712055109 +0200
+++ linux-4.5/fs/reiser4/plugin/inode_ops.c 2016-03-29 15:05:54.603153436 +0200
@@ -394,23 +394,25 @@
*/
/**
- * reiser4_follow_link_common - follow_link of inode operations
+ * reiser4_get_link_common: ->get_link() of inode_operations
* @dentry: dentry of symlink
- * @data:
*
- * This is common implementation of vfs's followlink method of struct
- * inode_operations.
* Assumes that inode's i_private points to the content of symbolic link.
*/
-const char *reiser4_follow_link_common(struct dentry *dentry, void **cookie)
+const char *reiser4_get_link_common(struct dentry *dentry,
+ struct inode *inode,
+ struct delayed_call *done)
{
+ if (!dentry)
+ return ERR_PTR(-ECHILD);
+
assert("vs-851", S_ISLNK(dentry->d_inode->i_mode));
- if (!dentry->d_inode->i_private
- || !reiser4_inode_get_flag(dentry->d_inode,
- REISER4_GENERIC_PTR_USED))
+ if (!dentry->d_inode->i_private ||
+ !reiser4_inode_get_flag(dentry->d_inode, REISER4_GENERIC_PTR_USED))
return ERR_PTR(RETERR(-EINVAL));
- return *cookie = dentry->d_inode->i_private;
+
+ return dentry->d_inode->i_private;
}
/**
@@ -877,3 +879,14 @@
dir->i_ctime = dir->i_mtime = CURRENT_TIME;
return reiser4_update_sd(dir);
}
+
+/*
+ Local variables:
+ c-indentation-style: "K&R"
+ mode-name: "LC"
+ c-basic-offset: 8
+ tab-width: 8
+ fill-column: 80
+ scroll-step: 1
+ End:
+*/
diff -u -r linux-4.4/fs/reiser4/plugin/node/node40.c linux-4.5/fs/reiser4/plugin/node/node40.c
--- linux-4.4/fs/reiser4/plugin/node/node40.c 2016-03-30 11:00:02.718055100 +0200
+++ linux-4.5/fs/reiser4/plugin/node/node40.c 2016-03-29 15:19:23.230063706 +0200
@@ -876,9 +876,10 @@
without this check? */
assert("nikita-3038", reiser4_schedulable());
/* copy data from user space */
- __copy_from_user(zdata(target->node) + offset,
- (const char __user *)data->data,
- (unsigned)data->length);
+ if (__copy_from_user(zdata(target->node) + offset,
+ (const char __user *)data->data,
+ (unsigned)data->length))
+ return RETERR(-EFAULT);
} else
/* copy from kernel space */
memcpy(zdata(target->node) + offset, data->data,
diff -u -r linux-4.4/fs/reiser4/plugin/object.c linux-4.5/fs/reiser4/plugin/object.c
--- linux-4.4/fs/reiser4/plugin/object.c 2016-03-30 11:00:02.719055099 +0200
+++ linux-4.5/fs/reiser4/plugin/object.c 2016-03-29 15:06:48.291082076 +0200
@@ -156,7 +156,7 @@
/* VFS methods for symlink files */
static struct inode_operations symlink_file_i_ops = {
.readlink = generic_readlink,
- .follow_link = reiser4_follow_link_common,
+ .get_link = reiser4_get_link_common,
.permission = reiser4_permission_common,
.setattr = reiser4_setattr_common,
.getattr = reiser4_getattr_common
diff -u -r linux-4.4/fs/reiser4/plugin/object.h linux-4.5/fs/reiser4/plugin/object.h
--- linux-4.4/fs/reiser4/plugin/object.h 2016-03-30 11:00:02.719055099 +0200
+++ linux-4.5/fs/reiser4/plugin/object.h 2016-03-29 15:08:27.208950159 +0200
@@ -24,7 +24,8 @@
umode_t mode, dev_t rdev);
int reiser4_rename_common(struct inode *old_dir, struct dentry *old_name,
struct inode *new_dir, struct dentry *new_name);
-const char *reiser4_follow_link_common(struct dentry *, void **cookie);
+const char *reiser4_get_link_common(struct dentry *, struct inode *inode,
+ struct delayed_call *done);
int reiser4_permission_common(struct inode *, int mask);
int reiser4_setattr_common(struct dentry *, struct iattr *);
int reiser4_getattr_common(struct vfsmount *mnt, struct dentry *,
next reply other threads:[~2016-03-30 9:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-30 9:20 Edward Shishkin [this message]
2016-04-06 0:42 ` [PATCH] reiser4: port for Linux-4.5 Ivan Shapovalov
2016-04-06 15:21 ` Edward Shishkin
2016-04-06 15:26 ` Ivan Shapovalov
2016-04-06 1:22 ` Ivan Shapovalov
2016-04-06 15:23 ` Edward Shishkin
2016-04-06 15:37 ` Ivan Shapovalov
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=56FB9A57.3040906@gmail.com \
--to=edward.shishkin@gmail.com \
--cc=reiserfs-devel@vger.kernel.org \
/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.