public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] debugfs: fixup to file removal protection series
@ 2016-03-06 19:59 Nicolai Stange
  2016-03-06 19:59 ` [PATCH 1/2] debugfs: fix DocBook comment of debugfs_use_file_start() Nicolai Stange
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Nicolai Stange @ 2016-03-06 19:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Nicolai Stange

Version v4 of the series ("fix debugfs file removal races")
to be found at http://lkml.kernel.org/g/8737sjo7qa.fsf@gmail.com
has been applied to the driver-core tree's driver-core-testing branch.

Unfortunately, the kbuild test robot discovered two minor issues.

To fix these, there are two options. The first one is to replace the
v4 version of the aforementioned series with v5 available at
http://lkml.kernel.org/g/1457267103-28910-1-git-send-email-nicstange@gmail.com

The other, rebaseless option is to apply the two fixup patches
contained within this series.

Both ways lead to identical code in the end.

This series is applicable to the the driver-core tree's
driver-core-testing branch. 

Nicolai Stange (2):
  debugfs: fix DocBook comment of debugfs_use_file_start()
  debugfs: inline dummy implementations of
    debugfs_use_file_start()/_finish()

 fs/debugfs/file.c       | 2 +-
 include/linux/debugfs.h | 6 ++++--
 2 files changed, 5 insertions(+), 3 deletions(-)

-- 
2.7.2

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

* [PATCH 1/2] debugfs: fix DocBook comment of debugfs_use_file_start()
  2016-03-06 19:59 [PATCH 0/2] debugfs: fixup to file removal protection series Nicolai Stange
@ 2016-03-06 19:59 ` Nicolai Stange
  2016-03-06 19:59 ` [PATCH 2/2] debugfs: inline dummy implementations of debugfs_use_file_start()/_finish() Nicolai Stange
  2016-03-22 13:17 ` [PATCH 0/2] debugfs: fixup to file removal protection series Nicolai Stange
  2 siblings, 0 replies; 4+ messages in thread
From: Nicolai Stange @ 2016-03-06 19:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Nicolai Stange

In commit 055cd38ba671 ("debugfs: prevent access to possibly dead
                         file_operations at file open")
debugfs_use_file_start() has been introduced. Unfortunately, the associated
DocBook comment hasn't been updated to properly reflect the change of the
'file' argument into 'dentry' during the evolution of the aforementioned
patch.

Catch up on this and rename '@file' to '@dentry' in the DocBook comment
associated with debugfs_use_file_start().

Signed-off-by: Nicolai Stange <nicstange@gmail.com>
---
 fs/debugfs/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/debugfs/file.c b/fs/debugfs/file.c
index 1a03e99..6a4b667 100644
--- a/fs/debugfs/file.c
+++ b/fs/debugfs/file.c
@@ -50,7 +50,7 @@ const struct file_operations debugfs_noop_file_operations = {
 
 /**
  * debugfs_use_file_start - mark the beginning of file data access
- * @file: the file object whose data is being accessed.
+ * @dentry: the dentry object whose data is being accessed.
  * @srcu_idx: a pointer to some memory to store a SRCU index in.
  *
  * Up to a matching call to debugfs_use_file_finish(), any
-- 
2.7.2

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

* [PATCH 2/2] debugfs: inline dummy implementations of debugfs_use_file_start()/_finish()
  2016-03-06 19:59 [PATCH 0/2] debugfs: fixup to file removal protection series Nicolai Stange
  2016-03-06 19:59 ` [PATCH 1/2] debugfs: fix DocBook comment of debugfs_use_file_start() Nicolai Stange
@ 2016-03-06 19:59 ` Nicolai Stange
  2016-03-22 13:17 ` [PATCH 0/2] debugfs: fixup to file removal protection series Nicolai Stange
  2 siblings, 0 replies; 4+ messages in thread
From: Nicolai Stange @ 2016-03-06 19:59 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Nicolai Stange

In commit 921d5cbeb37c ("debugfs: prevent access to removed files'
                         private data")
the functions debugfs_use_file_start() and debugfs_use_file_finish() have
been exported from the debugfs core.

Unfortunately, the inline keyword has been missed at their noop
implementations provided for the CONFIG_DEBUG_FS=n case.

Due to this lapse, the kbuild test robot moans on a powerpc defconfig
build:

  In file included from arch/powerpc/kernel/irq.c:54:0:
    include/linux/debugfs.h:185:12: error: 'debugfs_use_file_start'
      defined but not used [-Werror=unused-function]
      static int debugfs_use_file_start(const struct dentry *dentry,
                                        int *srcu_idx)

    include/linux/debugfs.h:191:13: error: 'debugfs_use_file_finish'
      defined but not used [-Werror=unused-function]
      static void debugfs_use_file_finish(int srcu_idx)

Add the inline keyword to the CONFIG_DEBUG_FS=n noop implementations of
debugfs_use_file_start() and debugfs_use_file_finish().

Signed-off-by: Nicolai Stange <nicstange@gmail.com>
---
 include/linux/debugfs.h | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index e7d2a99..1438e23 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -205,13 +205,15 @@ static inline void debugfs_remove(struct dentry *dentry)
 static inline void debugfs_remove_recursive(struct dentry *dentry)
 { }
 
-static int debugfs_use_file_start(const struct dentry *dentry, int *srcu_idx)
+static inline int debugfs_use_file_start(const struct dentry *dentry,
+					int *srcu_idx)
 	__acquires(&debugfs_srcu)
 {
 	return 0;
 }
 
-static void debugfs_use_file_finish(int srcu_idx) __releases(&debugfs_srcu)
+static inline void debugfs_use_file_finish(int srcu_idx)
+	__releases(&debugfs_srcu)
 { }
 
 #define DEFINE_DEBUGFS_ATTRIBUTE(__fops, __get, __set, __fmt)	\
-- 
2.7.2

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

* Re: [PATCH 0/2] debugfs: fixup to file removal protection series
  2016-03-06 19:59 [PATCH 0/2] debugfs: fixup to file removal protection series Nicolai Stange
  2016-03-06 19:59 ` [PATCH 1/2] debugfs: fix DocBook comment of debugfs_use_file_start() Nicolai Stange
  2016-03-06 19:59 ` [PATCH 2/2] debugfs: inline dummy implementations of debugfs_use_file_start()/_finish() Nicolai Stange
@ 2016-03-22 13:17 ` Nicolai Stange
  2 siblings, 0 replies; 4+ messages in thread
From: Nicolai Stange @ 2016-03-22 13:17 UTC (permalink / raw)
  To: Nicolai Stange; +Cc: Greg Kroah-Hartman, linux-kernel

Please drop as this has been fixed in the current v6 of the offending
series to be found here:

  http://lkml.kernel.org/g/1458652280-19785-1-git-send-email-nicstange@gmail.com

Thank you!

Nicolai

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

end of thread, other threads:[~2016-03-22 13:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-06 19:59 [PATCH 0/2] debugfs: fixup to file removal protection series Nicolai Stange
2016-03-06 19:59 ` [PATCH 1/2] debugfs: fix DocBook comment of debugfs_use_file_start() Nicolai Stange
2016-03-06 19:59 ` [PATCH 2/2] debugfs: inline dummy implementations of debugfs_use_file_start()/_finish() Nicolai Stange
2016-03-22 13:17 ` [PATCH 0/2] debugfs: fixup to file removal protection series Nicolai Stange

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox