linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* linux-next: manual merge of the efi tree with the efi-fixes tree
@ 2023-12-11  4:13 Stephen Rothwell
  2023-12-11  4:39 ` Stephen Rothwell
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2023-12-11  4:13 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, Masahisa Kojima

[-- Attachment #1: Type: text/plain, Size: 2873 bytes --]

Hi all,

Today's linux-next merge of the efi tree got a conflict in:

  fs/efivarfs/super.c

between commits:

  0b6d38bdd6f8 ("efivarfs: Free s_fs_info on unmount")
  ab5c4251a009 ("efivarfs: Move efivarfs list into superblock s_fs_info")

from the efi-fixes tree and commit:

  b501d5b36f58 ("efivarfs: automatically update super block flag")

from the efi tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc fs/efivarfs/super.c
index d7d9a3e189a0,42eff5ac7ab4..000000000000
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@@ -18,6 -20,32 +20,30 @@@
  
  #include "internal.h"
  
 -LIST_HEAD(efivarfs_list);
 -
+ struct efivarfs_info {
+ 	struct super_block *sb;
+ 	struct notifier_block nb;
+ };
+ 
+ static struct efivarfs_info info;
+ 
+ static int efivarfs_ops_notifier(struct notifier_block *nb, unsigned long event,
+ 				 void *data)
+ {
+ 	switch (event) {
+ 	case EFIVAR_OPS_RDONLY:
+ 		info.sb->s_flags |= SB_RDONLY;
+ 		break;
+ 	case EFIVAR_OPS_RDWR:
+ 		info.sb->s_flags &= ~SB_RDONLY;
+ 		break;
+ 	default:
+ 		return NOTIFY_DONE;
+ 	}
+ 
+ 	return NOTIFY_OK;
+ }
+ 
  static void efivarfs_evict_inode(struct inode *inode)
  {
  	clear_inode(inode);
@@@ -316,10 -345,17 +342,16 @@@ static int efivarfs_fill_super(struct s
  	if (!root)
  		return -ENOMEM;
  
+ 	info.sb = sb;
+ 	info.nb.notifier_call = efivarfs_ops_notifier;
+ 	err = blocking_notifier_chain_register(&efivar_ops_nh, &info.nb);
+ 	if (err)
+ 		return err;
+ 
 -	INIT_LIST_HEAD(&efivarfs_list);
 -
 -	err = efivar_init(efivarfs_callback, (void *)sb, true, &efivarfs_list);
 +	err = efivar_init(efivarfs_callback, (void *)sb, true,
 +			  &info->efivarfs_list);
  	if (err)
 -		efivar_entry_iter(efivarfs_destroy, &efivarfs_list, NULL);
 +		efivar_entry_iter(efivarfs_destroy, &info->efivarfs_list, NULL);
  
  	return err;
  }
@@@ -357,13 -399,15 +400,15 @@@ static int efivarfs_init_fs_context(str
  
  static void efivarfs_kill_sb(struct super_block *sb)
  {
 +	struct efivarfs_fs_info *sfi = sb->s_fs_info;
 +
+ 	blocking_notifier_chain_unregister(&efivar_ops_nh, &info.nb);
+ 	info.sb = NULL;
  	kill_litter_super(sb);
  
 -	if (!efivar_is_available())
 -		return;
 -
  	/* Remove all entries and destroy */
 -	efivar_entry_iter(efivarfs_destroy, &efivarfs_list, NULL);
 +	efivar_entry_iter(efivarfs_destroy, &sfi->efivarfs_list, NULL);
 +	kfree(sfi);
  }
  
  static struct file_system_type efivarfs_type = {

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: manual merge of the efi tree with the efi-fixes tree
  2023-12-11  4:13 linux-next: manual merge of the efi tree with the efi-fixes tree Stephen Rothwell
@ 2023-12-11  4:39 ` Stephen Rothwell
  2023-12-11  9:22   ` Ard Biesheuvel
  0 siblings, 1 reply; 4+ messages in thread
From: Stephen Rothwell @ 2023-12-11  4:39 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, Masahisa Kojima

[-- Attachment #1: Type: text/plain, Size: 3581 bytes --]

Hi all,

On Mon, 11 Dec 2023 15:13:03 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> 
> Today's linux-next merge of the efi tree got a conflict in:
> 
>   fs/efivarfs/super.c
> 
> between commits:
> 
>   0b6d38bdd6f8 ("efivarfs: Free s_fs_info on unmount")
>   ab5c4251a009 ("efivarfs: Move efivarfs list into superblock s_fs_info")
> 
> from the efi-fixes tree and commit:
> 
>   b501d5b36f58 ("efivarfs: automatically update super block flag")
> 
> from the efi tree.
> 
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging.  You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.

Actually the below is needed. ("info" is not a great name for, even a
static, global variable.  And maybe what I have called "einfo" could be
"sfi" like in efivarfs_kill_sb() ...)
-- 
Cheers,
Stephen Rothwell

diff --cc fs/efivarfs/super.c
index d7d9a3e189a0,42eff5ac7ab4..d209475a8a49
--- a/fs/efivarfs/super.c
+++ b/fs/efivarfs/super.c
@@@ -18,6 -20,32 +20,30 @@@
  
  #include "internal.h"
  
 -LIST_HEAD(efivarfs_list);
 -
+ struct efivarfs_info {
+ 	struct super_block *sb;
+ 	struct notifier_block nb;
+ };
+ 
+ static struct efivarfs_info info;
+ 
+ static int efivarfs_ops_notifier(struct notifier_block *nb, unsigned long event,
+ 				 void *data)
+ {
+ 	switch (event) {
+ 	case EFIVAR_OPS_RDONLY:
+ 		info.sb->s_flags |= SB_RDONLY;
+ 		break;
+ 	case EFIVAR_OPS_RDWR:
+ 		info.sb->s_flags &= ~SB_RDONLY;
+ 		break;
+ 	default:
+ 		return NOTIFY_DONE;
+ 	}
+ 
+ 	return NOTIFY_OK;
+ }
+ 
  static void efivarfs_evict_inode(struct inode *inode)
  {
  	clear_inode(inode);
@@@ -290,7 -317,6 +316,7 @@@ static int efivarfs_parse_param(struct 
  
  static int efivarfs_fill_super(struct super_block *sb, struct fs_context *fc)
  {
- 	struct efivarfs_fs_info *info = sb->s_fs_info;
++	struct efivarfs_fs_info *einfo = sb->s_fs_info;
  	struct inode *inode = NULL;
  	struct dentry *root;
  	int err;
@@@ -316,10 -345,17 +342,16 @@@
  	if (!root)
  		return -ENOMEM;
  
+ 	info.sb = sb;
+ 	info.nb.notifier_call = efivarfs_ops_notifier;
+ 	err = blocking_notifier_chain_register(&efivar_ops_nh, &info.nb);
+ 	if (err)
+ 		return err;
+ 
 -	INIT_LIST_HEAD(&efivarfs_list);
 -
 -	err = efivar_init(efivarfs_callback, (void *)sb, true, &efivarfs_list);
 +	err = efivar_init(efivarfs_callback, (void *)sb, true,
- 			  &info->efivarfs_list);
++			  &einfo->efivarfs_list);
  	if (err)
- 		efivar_entry_iter(efivarfs_destroy, &info->efivarfs_list, NULL);
 -		efivar_entry_iter(efivarfs_destroy, &efivarfs_list, NULL);
++		efivar_entry_iter(efivarfs_destroy, &einfo->efivarfs_list, NULL);
  
  	return err;
  }
@@@ -357,13 -399,15 +400,15 @@@ static int efivarfs_init_fs_context(str
  
  static void efivarfs_kill_sb(struct super_block *sb)
  {
 +	struct efivarfs_fs_info *sfi = sb->s_fs_info;
 +
+ 	blocking_notifier_chain_unregister(&efivar_ops_nh, &info.nb);
+ 	info.sb = NULL;
  	kill_litter_super(sb);
  
 -	if (!efivar_is_available())
 -		return;
 -
  	/* Remove all entries and destroy */
 -	efivar_entry_iter(efivarfs_destroy, &efivarfs_list, NULL);
 +	efivar_entry_iter(efivarfs_destroy, &sfi->efivarfs_list, NULL);
 +	kfree(sfi);
  }
  
  static struct file_system_type efivarfs_type = {

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: linux-next: manual merge of the efi tree with the efi-fixes tree
  2023-12-11  4:39 ` Stephen Rothwell
@ 2023-12-11  9:22   ` Ard Biesheuvel
  0 siblings, 0 replies; 4+ messages in thread
From: Ard Biesheuvel @ 2023-12-11  9:22 UTC (permalink / raw)
  To: Stephen Rothwell
  Cc: Linux Kernel Mailing List, Linux Next Mailing List, Masahisa Kojima

On Mon, 11 Dec 2023 at 05:39, Stephen Rothwell <sfr@canb.auug.org.au> wrote:
>
> Hi all,
>
> On Mon, 11 Dec 2023 15:13:03 +1100 Stephen Rothwell <sfr@canb.auug.org.au> wrote:
> >
> > Today's linux-next merge of the efi tree got a conflict in:
> >
> >   fs/efivarfs/super.c
> >
> > between commits:
> >
> >   0b6d38bdd6f8 ("efivarfs: Free s_fs_info on unmount")
> >   ab5c4251a009 ("efivarfs: Move efivarfs list into superblock s_fs_info")
> >
> > from the efi-fixes tree and commit:
> >
> >   b501d5b36f58 ("efivarfs: automatically update super block flag")
> >
> > from the efi tree.
> >
> > I fixed it up (see below) and can carry the fix as necessary. This
> > is now fixed as far as linux-next is concerned, but any non trivial
> > conflicts should be mentioned to your upstream maintainer when your tree
> > is submitted for merging.  You may also want to consider cooperating
> > with the maintainer of the conflicting tree to minimise any particularly
> > complex conflicts.
>
> Actually the below is needed. ("info" is not a great name for, even a
> static, global variable.  And maybe what I have called "einfo" could be
> "sfi" like in efivarfs_kill_sb() ...)

Apologies, I should have spotted this myself.

I'll fix this up and sync up the branches so any conflicts are
resolved before they reach you.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* linux-next: manual merge of the efi tree with the efi-fixes tree
@ 2023-05-30  4:32 Stephen Rothwell
  0 siblings, 0 replies; 4+ messages in thread
From: Stephen Rothwell @ 2023-05-30  4:32 UTC (permalink / raw)
  To: Ard Biesheuvel
  Cc: Arnd Bergmann, Ilias Apalodimas, Linux Kernel Mailing List,
	Linux Next Mailing List, Masahisa Kojima

[-- Attachment #1: Type: text/plain, Size: 1201 bytes --]

Hi all,

Today's linux-next merge of the efi tree got a conflict in:

  include/linux/efi.h

between commit:

  fd936fd8ac10 ("efi: fix missing prototype warnings")

from the efi-fixes tree and commit:

  5b6e3aa08c62 ("efi: expose efivar generic ops register function")

from the efi tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc include/linux/efi.h
index 571d1a6e1b74,657f7e203374..000000000000
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@@ -1338,6 -1350,7 +1350,9 @@@ bool efi_config_table_is_usable(const e
  	return xen_efi_config_table_is_usable(guid, table);
  }
  
 +umode_t efi_attr_is_visible(struct kobject *kobj, struct attribute *attr, int n);
 +
+ void efivars_generic_ops_register(void);
+ void efivars_generic_ops_unregister(void);
+ 
  #endif /* _LINUX_EFI_H */

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-12-11  9:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-11  4:13 linux-next: manual merge of the efi tree with the efi-fixes tree Stephen Rothwell
2023-12-11  4:39 ` Stephen Rothwell
2023-12-11  9:22   ` Ard Biesheuvel
  -- strict thread matches above, loose matches on Subject: below --
2023-05-30  4:32 Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).