Skip to content

Commit ecb5ec0

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull vfs pile raspberrypi#3 from Al Viro: "Assorted fixes and patches from the last cycle" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: [regression] chunk lost from bd9b51 vfs: make mounts and mountstats honor root dir like mountinfo does vfs: cleanup show_mountinfo init: fix read-write root mount unfuck binfmt_misc.c (broken by commit e6084d4) vm_area_operations: kill ->migrate() new helper: iter_is_iovec() move_extent_per_page(): get rid of unused w_flags lustre: get rid of playing with ->fs btrfs: filp_open() returns ERR_PTR() on failure, not NULL...
2 parents 298647e + e3bb504 commit ecb5ec0

17 files changed

Lines changed: 29 additions & 119 deletions

File tree

‎drivers/staging/lustre/lustre/include/linux/lustre_compat25.h‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,6 @@
4242

4343
#include "lustre_patchless_compat.h"
4444

45-
# define LOCK_FS_STRUCT(fs) spin_lock(&(fs)->lock)
46-
# define UNLOCK_FS_STRUCT(fs) spin_unlock(&(fs)->lock)
47-
48-
static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
49-
struct dentry *dentry)
50-
{
51-
struct path path;
52-
struct path old_pwd;
53-
54-
path.mnt = mnt;
55-
path.dentry = dentry;
56-
LOCK_FS_STRUCT(fs);
57-
old_pwd = fs->pwd;
58-
path_get(&path);
59-
fs->pwd = path;
60-
UNLOCK_FS_STRUCT(fs);
61-
62-
if (old_pwd.dentry)
63-
path_put(&old_pwd);
64-
}
65-
66-
6745
/*
6846
* set ATTR_BLOCKS to a high value to avoid any risk of collision with other
6947
* ATTR_* attributes (see bug 13828)
@@ -110,8 +88,6 @@ static inline void ll_set_fs_pwd(struct fs_struct *fs, struct vfsmount *mnt,
11088
#define cfs_bio_io_error(a, b) bio_io_error((a))
11189
#define cfs_bio_endio(a, b, c) bio_endio((a), (c))
11290

113-
#define cfs_fs_pwd(fs) ((fs)->pwd.dentry)
114-
#define cfs_fs_mnt(fs) ((fs)->pwd.mnt)
11591
#define cfs_path_put(nd) path_put(&(nd)->path)
11692

11793

‎drivers/staging/lustre/lustre/llite/dir.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ int ll_dir_setdirstripe(struct inode *dir, struct lmv_user_md *lump,
661661
int mode;
662662
int err;
663663

664-
mode = (0755 & (S_IRWXUGO|S_ISVTX) & ~current->fs->umask) | S_IFDIR;
664+
mode = (0755 & ~current_umask()) | S_IFDIR;
665665
op_data = ll_prep_md_op_data(NULL, dir, NULL, filename,
666666
strlen(filename), mode, LUSTRE_OPC_MKDIR,
667667
lump);

‎drivers/staging/lustre/lustre/llite/llite_lib.c‎

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2372,21 +2372,6 @@ char *ll_get_fsname(struct super_block *sb, char *buf, int buflen)
23722372
return buf;
23732373
}
23742374

2375-
static char *ll_d_path(struct dentry *dentry, char *buf, int bufsize)
2376-
{
2377-
char *path = NULL;
2378-
2379-
struct path p;
2380-
2381-
p.dentry = dentry;
2382-
p.mnt = current->fs->root.mnt;
2383-
path_get(&p);
2384-
path = d_path(&p, buf, bufsize);
2385-
path_put(&p);
2386-
2387-
return path;
2388-
}
2389-
23902375
void ll_dirty_page_discard_warn(struct page *page, int ioret)
23912376
{
23922377
char *buf, *path = NULL;
@@ -2398,7 +2383,7 @@ void ll_dirty_page_discard_warn(struct page *page, int ioret)
23982383
if (buf != NULL) {
23992384
dentry = d_find_alias(page->mapping->host);
24002385
if (dentry != NULL)
2401-
path = ll_d_path(dentry, buf, PAGE_SIZE);
2386+
path = dentry_path_raw(dentry, buf, PAGE_SIZE);
24022387
}
24032388

24042389
CDEBUG(D_WARNING,

‎fs/binfmt_misc.c‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ static char *scanarg(char *s, char del)
254254
return NULL;
255255
}
256256
}
257+
s[-1] ='\0';
257258
return s;
258259
}
259260

@@ -378,8 +379,7 @@ static Node *create_entry(const char __user *buffer, size_t count)
378379
p = scanarg(p, del);
379380
if (!p)
380381
goto einval;
381-
p[-1] = '\0';
382-
if (p == e->magic)
382+
if (!e->magic[0])
383383
goto einval;
384384
if (USE_DEBUG)
385385
print_hex_dump_bytes(
@@ -391,8 +391,7 @@ static Node *create_entry(const char __user *buffer, size_t count)
391391
p = scanarg(p, del);
392392
if (!p)
393393
goto einval;
394-
p[-1] = '\0';
395-
if (p == e->mask) {
394+
if (!e->mask[0]) {
396395
e->mask = NULL;
397396
pr_debug("register: mask[raw]: none\n");
398397
} else if (USE_DEBUG)

‎fs/btrfs/volumes.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1485,7 +1485,7 @@ static void update_dev_time(char *path_name)
14851485
struct file *filp;
14861486

14871487
filp = filp_open(path_name, O_RDWR, 0);
1488-
if (!filp)
1488+
if (IS_ERR(filp))
14891489
return;
14901490
file_update_time(filp);
14911491
filp_close(filp, NULL);

‎fs/ext4/move_extent.c‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,6 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode,
267267
handle_t *handle;
268268
ext4_lblk_t orig_blk_offset, donor_blk_offset;
269269
unsigned long blocksize = orig_inode->i_sb->s_blocksize;
270-
unsigned int w_flags = 0;
271270
unsigned int tmp_data_size, data_size, replaced_size;
272271
int err2, jblocks, retries = 0;
273272
int replaced_count = 0;
@@ -288,9 +287,6 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode,
288287
return 0;
289288
}
290289

291-
if (segment_eq(get_fs(), KERNEL_DS))
292-
w_flags |= AOP_FLAG_UNINTERRUPTIBLE;
293-
294290
orig_blk_offset = orig_page_offset * blocks_per_page +
295291
data_offset_in_page;
296292

‎fs/kernfs/file.c‎

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -448,27 +448,6 @@ static struct mempolicy *kernfs_vma_get_policy(struct vm_area_struct *vma,
448448
return pol;
449449
}
450450

451-
static int kernfs_vma_migrate(struct vm_area_struct *vma,
452-
const nodemask_t *from, const nodemask_t *to,
453-
unsigned long flags)
454-
{
455-
struct file *file = vma->vm_file;
456-
struct kernfs_open_file *of = kernfs_of(file);
457-
int ret;
458-
459-
if (!of->vm_ops)
460-
return 0;
461-
462-
if (!kernfs_get_active(of->kn))
463-
return 0;
464-
465-
ret = 0;
466-
if (of->vm_ops->migrate)
467-
ret = of->vm_ops->migrate(vma, from, to, flags);
468-
469-
kernfs_put_active(of->kn);
470-
return ret;
471-
}
472451
#endif
473452

474453
static const struct vm_operations_struct kernfs_vm_ops = {
@@ -479,7 +458,6 @@ static const struct vm_operations_struct kernfs_vm_ops = {
479458
#ifdef CONFIG_NUMA
480459
.set_policy = kernfs_vma_set_policy,
481460
.get_policy = kernfs_vma_get_policy,
482-
.migrate = kernfs_vma_migrate,
483461
#endif
484462
};
485463

‎fs/proc_namespace.c‎

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ static void show_type(struct seq_file *m, struct super_block *sb)
9191

9292
static int show_vfsmnt(struct seq_file *m, struct vfsmount *mnt)
9393
{
94+
struct proc_mounts *p = proc_mounts(m);
9495
struct mount *r = real_mount(mnt);
9596
int err = 0;
9697
struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
@@ -104,7 +105,10 @@ static int show_vfsmnt(struct seq_file *m, struct vfsmount *mnt)
104105
mangle(m, r->mnt_devname ? r->mnt_devname : "none");
105106
}
106107
seq_putc(m, ' ');
107-
seq_path(m, &mnt_path, " \t\n\\");
108+
/* mountpoints outside of chroot jail will give SEQ_SKIP on this */
109+
err = seq_path_root(m, &mnt_path, &p->root, " \t\n\\");
110+
if (err)
111+
goto out;
108112
seq_putc(m, ' ');
109113
show_type(m, sb);
110114
seq_puts(m, __mnt_is_readonly(mnt) ? " ro" : " rw");
@@ -125,7 +129,6 @@ static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt)
125129
struct mount *r = real_mount(mnt);
126130
struct super_block *sb = mnt->mnt_sb;
127131
struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
128-
struct path root = p->root;
129132
int err = 0;
130133

131134
seq_printf(m, "%i %i %u:%u ", r->mnt_id, r->mnt_parent->mnt_id,
@@ -139,7 +142,7 @@ static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt)
139142
seq_putc(m, ' ');
140143

141144
/* mountpoints outside of chroot jail will give SEQ_SKIP on this */
142-
err = seq_path_root(m, &mnt_path, &root, " \t\n\\");
145+
err = seq_path_root(m, &mnt_path, &p->root, " \t\n\\");
143146
if (err)
144147
goto out;
145148

@@ -182,6 +185,7 @@ static int show_mountinfo(struct seq_file *m, struct vfsmount *mnt)
182185

183186
static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt)
184187
{
188+
struct proc_mounts *p = proc_mounts(m);
185189
struct mount *r = real_mount(mnt);
186190
struct path mnt_path = { .dentry = mnt->mnt_root, .mnt = mnt };
187191
struct super_block *sb = mnt_path.dentry->d_sb;
@@ -201,7 +205,10 @@ static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt)
201205

202206
/* mount point */
203207
seq_puts(m, " mounted on ");
204-
seq_path(m, &mnt_path, " \t\n\\");
208+
/* mountpoints outside of chroot jail will give SEQ_SKIP on this */
209+
err = seq_path_root(m, &mnt_path, &p->root, " \t\n\\");
210+
if (err)
211+
goto out;
205212
seq_putc(m, ' ');
206213

207214
/* file system type */
@@ -216,6 +223,7 @@ static int show_vfsstat(struct seq_file *m, struct vfsmount *mnt)
216223
}
217224

218225
seq_putc(m, '\n');
226+
out:
219227
return err;
220228
}
221229

‎include/linux/migrate.h‎

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@ extern int migrate_pages(struct list_head *l, new_page_t new, free_page_t free,
3636

3737
extern int migrate_prep(void);
3838
extern int migrate_prep_local(void);
39-
extern int migrate_vmas(struct mm_struct *mm,
40-
const nodemask_t *from, const nodemask_t *to,
41-
unsigned long flags);
4239
extern void migrate_page_copy(struct page *newpage, struct page *page);
4340
extern int migrate_huge_page_move_mapping(struct address_space *mapping,
4441
struct page *newpage, struct page *page);
@@ -57,13 +54,6 @@ static inline int migrate_pages(struct list_head *l, new_page_t new,
5754
static inline int migrate_prep(void) { return -ENOSYS; }
5855
static inline int migrate_prep_local(void) { return -ENOSYS; }
5956

60-
static inline int migrate_vmas(struct mm_struct *mm,
61-
const nodemask_t *from, const nodemask_t *to,
62-
unsigned long flags)
63-
{
64-
return -ENOSYS;
65-
}
66-
6757
static inline void migrate_page_copy(struct page *newpage,
6858
struct page *page) {}
6959

‎include/linux/mm.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,6 @@ struct vm_operations_struct {
286286
*/
287287
struct mempolicy *(*get_policy)(struct vm_area_struct *vma,
288288
unsigned long addr);
289-
int (*migrate)(struct vm_area_struct *vma, const nodemask_t *from,
290-
const nodemask_t *to, unsigned long flags);
291289
#endif
292290
/* called by sys_remap_file_pages() to populate non-linear mapping */
293291
int (*remap_pages)(struct vm_area_struct *vma, unsigned long addr,

0 commit comments

Comments
 (0)