From e765acb4673f377c53505c01279c040906bd706e Mon Sep 17 00:00:00 2001 From: Geert Uytterhoeven Date: Fri, 3 May 2013 22:20:38 +0200 Subject: nubus: Kill nubus_proc_detach_device() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 59d8053f1e16904d54ed7469d4b36801ea6b8f2c ("proc: Move non-public stuff from linux/proc_fs.h to fs/proc/internal.h") broke Apple NuBus support: drivers/nubus/proc.c: In function ‘nubus_proc_detach_device’: drivers/nubus/proc.c:156: error: dereferencing pointer to incomplete type drivers/nubus/proc.c:158: error: dereferencing pointer to incomplete type Fortunately nubus_proc_detach_device() is unused, and appears to have never been used, so just remove it. Signed-off-by: Geert Uytterhoeven Signed-off-by: Al Viro --- include/linux/nubus.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include') diff --git a/include/linux/nubus.h b/include/linux/nubus.h index b3740527571..6165b2c6204 100644 --- a/include/linux/nubus.h +++ b/include/linux/nubus.h @@ -87,7 +87,6 @@ static inline void nubus_proc_init(void) {} #endif int get_nubus_list(char *buf); int nubus_proc_attach_device(struct nubus_dev *dev); -int nubus_proc_detach_device(struct nubus_dev *dev); /* If we need more precision we can add some more of these */ struct nubus_dev* nubus_find_device(unsigned short category, unsigned short type, -- cgit v1.2.3-70-g09d2 From 5ae98f1589e076e4b314fc54ae2beac58842ddc2 Mon Sep 17 00:00:00 2001 From: Jan Kara Date: Sat, 4 May 2013 00:11:23 +0200 Subject: fs: Fix hang with BSD accounting on frozen filesystem When BSD process accounting is enabled and logs information to a filesystem which gets frozen, system easily becomes unusable because each attempt to account process information blocks. Thus e.g. every task gets blocked in exit. It seems better to drop accounting information (which can already happen when filesystem is running out of space) instead of locking system up. So we just skip the write if the filesystem is frozen. Reported-by: Nikola Ciprich Signed-off-by: Jan Kara Signed-off-by: Al Viro --- include/linux/fs.h | 7 +++++++ kernel/acct.c | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/linux/fs.h b/include/linux/fs.h index e8cd6b83967..b5a24ba83b6 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h @@ -2227,6 +2227,13 @@ static inline void file_start_write(struct file *file) __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, true); } +static inline bool file_start_write_trylock(struct file *file) +{ + if (!S_ISREG(file_inode(file)->i_mode)) + return true; + return __sb_start_write(file_inode(file)->i_sb, SB_FREEZE_WRITE, false); +} + static inline void file_end_write(struct file *file) { if (!S_ISREG(file_inode(file)->i_mode)) diff --git a/kernel/acct.c b/kernel/acct.c index 85389fe2abd..8d6e145138b 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -539,11 +539,16 @@ static void do_acct_process(struct bsd_acct_struct *acct, ac.ac_rw = encode_comp_t(ac.ac_io / 1024); ac.ac_swaps = encode_comp_t(0); + /* + * Get freeze protection. If the fs is frozen, just skip the write + * as we could deadlock the system otherwise. + */ + if (!file_start_write_trylock(file)) + goto out; /* * Kernel segment override to datasegment and write it * to the accounting file. */ - file_start_write(file); fs = get_fs(); set_fs(KERNEL_DS); /* -- cgit v1.2.3-70-g09d2 From 2b3b9bb03a9fb1e4c72947cc235771c6455ec7c9 Mon Sep 17 00:00:00 2001 From: James Hogan Date: Wed, 27 Mar 2013 10:47:13 +0000 Subject: hostfs: move HOSTFS_SUPER_MAGIC to Move HOSTFS_SUPER_MAGIC to to be with it's magical friends from other file systems. Reported-by: Al Viro Signed-off-by: James Hogan Signed-off-by: Al Viro --- fs/hostfs/hostfs_kern.c | 3 +-- include/uapi/linux/magic.h | 1 + 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/fs/hostfs/hostfs_kern.c b/fs/hostfs/hostfs_kern.c index 95b9c87cb24..f2372ef8085 100644 --- a/fs/hostfs/hostfs_kern.c +++ b/fs/hostfs/hostfs_kern.c @@ -7,6 +7,7 @@ */ #include +#include #include #include #include @@ -45,8 +46,6 @@ static const struct dentry_operations hostfs_dentry_ops = { static char *root_ino = ""; static int append = 0; -#define HOSTFS_SUPER_MAGIC 0x00c0ffee - static const struct inode_operations hostfs_iops; static const struct inode_operations hostfs_dir_iops; static const struct inode_operations hostfs_link_iops; diff --git a/include/uapi/linux/magic.h b/include/uapi/linux/magic.h index 249df3720be..2944278a8ba 100644 --- a/include/uapi/linux/magic.h +++ b/include/uapi/linux/magic.h @@ -30,6 +30,7 @@ #define JFFS2_SUPER_MAGIC 0x72b6 #define PSTOREFS_MAGIC 0x6165676C #define EFIVARFS_MAGIC 0xde5e81e4 +#define HOSTFS_SUPER_MAGIC 0x00c0ffee #define MINIX_SUPER_MAGIC 0x137F /* minix v1 fs, 14 char names */ #define MINIX_SUPER_MAGIC2 0x138F /* minix v1 fs, 30 char names */ -- cgit v1.2.3-70-g09d2