From: Michael Ole Olsen <gnu@gmx.net>
To: xfs <xfs@oss.sgi.com>
Subject: patch 2.6.30 and 2.6.30.1 xfs/nfs oops fix, radix tree
Date: Tue, 21 Jul 2009 03:24:55 +0200 [thread overview]
Message-ID: <20090721012455.GG3229@rlogin.dk> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 7236 bytes --]
Eric has been very helpful in helping me downgrade xfs in 2.6.30.1 to 2.6.28.7
version (getting 2.6.28.7 to compile in 2.6.30.1) which removed the oopses.
Just wanted to post here for other people like me that don't have an option
of downgrading their kernel (need i.e. mdadm>=2.6.30).
for those that use special features of i.e. mdadm for raid which requires at
least 2.6.30 to assemble the raid6 with Q blocks on the last disk i.e. this is
about the only option.
Xfs seems to oops all the time in >=2.6.30 on my boxes with radix tree trace,
that is why the downgrade was made.
I havn't had a single issue since downgrading which is a few days ago now,
before I used to get up to 3-4 oopses a day in 2.6.30 or 2.6.30.1 with
nfs+xfs and lots of npd!=np in dmesg which are now gone
Here is the patch that I got from him that fixes the oopses in >=2.6.30 with
nfs, I will be adding it to the bugzilla as well until the real bug is fixed
http://bugzilla.kernel.org/show_bug.cgi?id=13375
The patch is simply the 2.6.28.7 xfs code, modified to compile on 2.6.30
and 2.6.30.1 , no guarantees (although I have extensively tested for some days
now without problems whatsoever).
# author eric @ xfs.org
# fixes xfs radix tree oopses in 2.6.30 and 2.6.30.1 with nfs kernel server
# and also perhaps selinux oopses (nfs_setuid) as well (havn't tested)
# this patch is based on linux 2.6.28.7 xfs kernel code,
# and should only be needed if you need kernel code from
# 2.6.30 but xfs keeps oopsing in that kernel, i.e. mdadm from >=2.6.30 kernel
Index: linux-2.6.28.7/fs/xfs/linux-2.6/xfs_cred.h
===================================================================
--- linux-2.6.28.7.orig/fs/xfs/linux-2.6/xfs_cred.h
+++ linux-2.6.28.7/fs/xfs/linux-2.6/xfs_cred.h
@@ -23,9 +23,7 @@
/*
* Credentials
*/
-typedef struct cred {
- /* EMPTY */
-} cred_t;
+typedef struct cred cred_t;
extern struct cred *sys_cred;
Index: linux-2.6.28.7/fs/xfs/xfs_acl.c
===================================================================
--- linux-2.6.28.7.orig/fs/xfs/xfs_acl.c
+++ linux-2.6.28.7/fs/xfs/xfs_acl.c
@@ -366,7 +366,7 @@ xfs_acl_allow_set(
return ENOTDIR;
if (vp->i_sb->s_flags & MS_RDONLY)
return EROFS;
- if (XFS_I(vp)->i_d.di_uid != current->fsuid && !capable(CAP_FOWNER))
+ if (XFS_I(vp)->i_d.di_uid != current_fsuid() && !capable(CAP_FOWNER))
return EPERM;
return 0;
}
@@ -413,13 +413,13 @@ xfs_acl_access(
switch (fap->acl_entry[i].ae_tag) {
case ACL_USER_OBJ:
seen_userobj = 1;
- if (fuid != current->fsuid)
+ if (fuid != current_fsuid())
continue;
matched.ae_tag = ACL_USER_OBJ;
matched.ae_perm = allows;
break;
case ACL_USER:
- if (fap->acl_entry[i].ae_id != current->fsuid)
+ if (fap->acl_entry[i].ae_id != current_fsuid())
continue;
matched.ae_tag = ACL_USER;
matched.ae_perm = allows;
Index: linux-2.6.28.7/fs/xfs/linux-2.6/xfs_ioctl.c
===================================================================
--- linux-2.6.28.7.orig/fs/xfs/linux-2.6/xfs_ioctl.c
+++ linux-2.6.28.7/fs/xfs/linux-2.6/xfs_ioctl.c
@@ -256,6 +256,7 @@ xfs_open_by_handle(
struct file *parfilp,
struct inode *parinode)
{
+ const struct cred *cred = current_cred();
int error;
int new_fd;
int permflag;
@@ -321,7 +322,7 @@ xfs_open_by_handle(
mntget(parfilp->f_path.mnt);
/* Create file pointer. */
- filp = dentry_open(dentry, parfilp->f_path.mnt, hreq.oflags);
+ filp = dentry_open(dentry, parfilp->f_path.mnt, hreq.oflags, cred);
if (IS_ERR(filp)) {
put_unused_fd(new_fd);
return -XFS_ERROR(-PTR_ERR(filp));
@@ -1007,7 +1008,7 @@ xfs_ioctl_setattr(
* to the file owner ID, except in cases where the
* CAP_FSETID capability is applicable.
*/
- if (current->fsuid != ip->i_d.di_uid && !capable(CAP_FOWNER)) {
+ if (current_fsuid() != ip->i_d.di_uid && !capable(CAP_FOWNER)) {
code = XFS_ERROR(EPERM);
goto error_return;
}
Index: linux-2.6.28.7/fs/xfs/linux-2.6/xfs_iops.c
===================================================================
--- linux-2.6.28.7.orig/fs/xfs/linux-2.6/xfs_iops.c
+++ linux-2.6.28.7/fs/xfs/linux-2.6/xfs_iops.c
@@ -228,7 +228,7 @@ xfs_vn_mknod(
xfs_dentry_to_name(&name, dentry);
if (IS_POSIXACL(dir) && !default_acl)
- mode &= ~current->fs->umask;
+ mode &= ~current_umask();
switch (mode & S_IFMT) {
case S_IFCHR:
@@ -422,7 +422,7 @@ xfs_vn_symlink(
mode_t mode;
mode = S_IFLNK |
- (irix_symlink_mode ? 0777 & ~current->fs->umask : S_IRWXUGO);
+ (irix_symlink_mode ? 0777 & ~current_umask() : S_IRWXUGO);
xfs_dentry_to_name(&name, dentry);
error = xfs_symlink(XFS_I(dir), &name, symname, mode, &cip, NULL);
Index: linux-2.6.28.7/fs/xfs/linux-2.6/xfs_super.c
===================================================================
--- linux-2.6.28.7.orig/fs/xfs/linux-2.6/xfs_super.c
+++ linux-2.6.28.7/fs/xfs/linux-2.6/xfs_super.c
@@ -1351,14 +1351,15 @@ xfs_fs_remount(
* need to take care of themetadata. Once that's done write a dummy
* record to dirty the log in case of a crash while frozen.
*/
-STATIC void
-xfs_fs_lockfs(
+STATIC int
+xfs_fs_freeze(
struct super_block *sb)
{
struct xfs_mount *mp = XFS_M(sb);
xfs_attr_quiesce(mp);
xfs_fs_log_dummy(mp);
+ return 0;
}
STATIC int
@@ -1847,7 +1848,7 @@ static struct super_operations xfs_super
.put_super = xfs_fs_put_super,
.write_super = xfs_fs_write_super,
.sync_fs = xfs_fs_sync_super,
- .write_super_lockfs = xfs_fs_lockfs,
+ .freeze_fs = xfs_fs_freeze,
.statfs = xfs_fs_statfs,
.remount_fs = xfs_fs_remount,
.show_options = xfs_fs_show_options,
Index: linux-2.6.28.7/fs/xfs/linux-2.6/xfs_file.c
===================================================================
--- linux-2.6.28.7.orig/fs/xfs/linux-2.6/xfs_file.c
+++ linux-2.6.28.7/fs/xfs/linux-2.6/xfs_file.c
@@ -299,9 +299,9 @@ xfs_file_ioctl_invis(
STATIC int
xfs_vm_page_mkwrite(
struct vm_area_struct *vma,
- struct page *page)
+ struct vm_fault *vmf)
{
- return block_page_mkwrite(vma, page, xfs_get_blocks);
+ return block_page_mkwrite(vma, vmf, xfs_get_blocks);
}
const struct file_operations xfs_file_operations = {
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 835 bytes --]
[-- Attachment #2: Type: text/plain, Size: 121 bytes --]
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
next reply other threads:[~2009-07-21 1:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-21 1:24 Michael Ole Olsen [this message]
2009-07-21 7:33 ` patch 2.6.30 and 2.6.30.1 xfs/nfs oops fix, radix tree Michael Weissenbacher
2009-07-22 12:45 ` Martin Spott
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=20090721012455.GG3229@rlogin.dk \
--to=gnu@gmx.net \
--cc=xfs@oss.sgi.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox