From f19866e5cb04f8f007cb422132ea4611cdacc8e3 Mon Sep 17 00:00:00 2001 From: André Fabian Silva Delgado Date: Thu, 8 Oct 2015 08:28:26 -0300 Subject: Linux-libre 4.2.3-gnu --- fs/aufs/sysfs.c | 48 ++++++++---------------------------------------- 1 file changed, 8 insertions(+), 40 deletions(-) (limited to 'fs/aufs/sysfs.c') diff --git a/fs/aufs/sysfs.c b/fs/aufs/sysfs.c index 549f71d1a..cc74d02b1 100644 --- a/fs/aufs/sysfs.c +++ b/fs/aufs/sysfs.c @@ -1,18 +1,5 @@ /* * Copyright (C) 2005-2015 Junjiro R. Okajima - * - * This program, aufs is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . */ /* @@ -23,30 +10,7 @@ #include #include "aufs.h" -#ifdef CONFIG_AUFS_FS_MODULE -/* this entry violates the "one line per file" policy of sysfs */ -static ssize_t config_show(struct kobject *kobj, struct kobj_attribute *attr, - char *buf) -{ - ssize_t err; - static char *conf = -/* this file is generated at compiling */ -#include "conf.str" - ; - - err = snprintf(buf, PAGE_SIZE, conf); - if (unlikely(err >= PAGE_SIZE)) - err = -EFBIG; - return err; -} - -static struct kobj_attribute au_config_attr = __ATTR_RO(config); -#endif - static struct attribute *au_attr[] = { -#ifdef CONFIG_AUFS_FS_MODULE - &au_config_attr.attr, -#endif NULL, /* need to NULL terminate the list of attributes */ }; @@ -97,9 +61,11 @@ static int sysaufs_si_br(struct seq_file *seq, struct super_block *sb, case AuBrSysfs_BR: path.mnt = au_br_mnt(br); path.dentry = au_h_dptr(root, bindex); - au_seq_path(seq, &path); - au_optstr_br_perm(&perm, br->br_perm); - err = seq_printf(seq, "=%s\n", perm.a); + err = au_seq_path(seq, &path); + if (!err) { + au_optstr_br_perm(&perm, br->br_perm); + err = seq_printf(seq, "=%s\n", perm.a); + } break; case AuBrSysfs_BRID: err = seq_printf(seq, "%d\n", br->br_id); @@ -260,7 +226,9 @@ static int au_brinfo(struct super_block *sb, union aufs_brinfo __user *arg) if (unlikely(err)) break; - au_seq_path(seq, &br->br_path); + err = au_seq_path(seq, &br->br_path); + if (unlikely(err)) + break; err = seq_putc(seq, '\0'); if (!err && seq->count <= sz) { err = copy_to_user(arg->path, seq->buf, seq->count); -- cgit v1.2.3-54-g00ecf