Re: [PATCH 01/20] efi: Add support for a UEFI variable filesystem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 10/26/2012 03:51 PM, Matt Fleming wrote:
> +static int efivarfs_unlink(struct inode *dir, struct dentry *dentry)
> +{
> +	struct efivar_entry *var = dentry->d_inode->i_private;
> +	struct efivars *efivars = var->efivars;
> +	efi_status_t status;
> +
> +	spin_lock(&efivars->lock);
> +
> +	status = efivars->ops->set_variable(var->var.VariableName,
> +					&var->var.VendorGuid,
> +					    0, 0, NULL);
> +
> +	if (status == EFI_SUCCESS || status == EFI_NOT_FOUND) {
> +		list_del(&var->list);
> +		spin_unlock(&efivars->lock);
> +		efivar_unregister(var);
> +		drop_nlink(dir);

This should be  drop_nlink(dentry->d_inode);

I'm getting warnings when testing Fedora 18 kernel with efivarfs patch
backported. i_nlink underflowed.

[root@localhost ~]# mount -t efivarfs - /sys/firmware/efi/efivars/
[root@localhost ~]# ls -1 /sys/firmware/efi/efivars/ | wc -l
28
[root@localhost ~]# stat -c%h /sys/firmware/efi/efivars/
2
[root@localhost ~]# rm -f /sys/firmware/efi/efivars/*
[   41.690805] ------------[ cut here ]------------
[   41.692975] WARNING: at fs/inode.c:280 drop_nlink+0x46/0x50()
[   41.694546] Modules linked in: nf_conntrack_netbios_ns nf_conntrack_broadcast ipt_MASQUERADE ip6table_mangle ip6t_REJECT nf_conntrack_ipv6 nf_defrag_ipv6 ip6table_filter ip6_tables iptable_nat nf_nat iptable_mangle nf_conntrack_ipv4 nf_defrag_ipv4 xt_conntrack nf_conntrack vfat fat i2c_piix4 i2c_core microcode virtio_net
[   41.701583] Pid: 822, comm: rm Tainted: G        W    3.6.11-3.fc18.x86_64.debug #1
[   41.703008] Call Trace:
[   41.703499]  [<ffffffff8106781f>] warn_slowpath_common+0x7f/0xc0
[   41.704591]  [<ffffffff8106787a>] warn_slowpath_null+0x1a/0x20
[   41.705777]  [<ffffffff811eb266>] drop_nlink+0x46/0x50
[   41.706855]  [<ffffffff81553fca>] efivarfs_unlink+0x8a/0xd0
[   41.707952]  [<ffffffff811dd75e>] vfs_unlink+0x9e/0x110
[   41.710800]  [<ffffffff811dd90d>] do_unlinkat+0x13d/0x1a0
[   41.712096]  [<ffffffff810d6b6d>] ? trace_hardirqs_on_caller+0x10d/0x1a0
[   41.713808]  [<ffffffff8110181c>] ? __audit_syscall_entry+0xcc/0x300
[   41.714983]  [<ffffffff8134f50e>] ? trace_hardirqs_on_thunk+0x3a/0x3f
[   41.716548]  [<ffffffff811e025b>] sys_unlinkat+0x1b/0x50
[   41.717694]  [<ffffffff816e7fe9>] system_call_fastpath+0x16/0x1b
[   41.718995] ---[ end trace 33f799b901d1db9e ]---
[root@localhost ~]# ls -1 /sys/firmware/efi/efivars/ | wc -l
15
[root@localhost ~]# stat -c%h /sys/firmware/efi/efivars/
4294967285


> +		dput(dentry);
> +		return 0;
> +	}
--
To unsubscribe from this list: send the line "unsubscribe linux-efi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux