Skip to contentSkip to conversation

arch/x86/kernel/msr.c: Add another file_inode()

PATCH New Andre Richter 2 participants 2 messages Oct 8, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arch/x86/kernel/msr.c: Add another file_inode()

As discussed in [1], exchange f_mapping->host with file_inode().

[1] https://lkml.org/lkml/2013/10/7/499

---
 arch/x86/kernel/msr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/msr.c +1 -1
index 88458fa..05266b5 100644
@@ -46,7 +46,7 @@ static struct class *msr_class;
 static loff_t msr_seek(struct file *file, loff_t offset, int orig)
 {
 	loff_t ret;
-	struct inode *inode = file->f_mapping->host;
+	struct inode *inode = file_inode(file);
 
 	mutex_lock(&inode->i_mutex);
 	switch (orig) {
Signature · 1 line
1.8.1.2
#1 lore raw

[tip:x86/cleanups] x86, msr: Use file_inode(), not f_mapping-> host

x86, msr: Use file_inode(), not f_mapping->host
Commit-ID:  122498738417c73943b71294c60ec34fc110f5d6
Gitweb:     http://git.kernel.org/tip/122498738417c73943b71294c60ec34fc110f5d6
Author:     Andre Richter <[email protected]>
AuthorDate: Tue, 8 Oct 2013 11:22:22 +0200
Committer:  H. Peter Anvin <[email protected]>
CommitDate: Tue, 8 Oct 2013 12:01:29 -0700

x86, msr: Use file_inode(), not f_mapping->host

As discussed in [1], exchange f_mapping->host with file_inode(). This is a bug, but happens to be non-manifest in this case.

[1] http://lkml.kernel.org/r/[email protected]

---
 arch/x86/kernel/msr.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/msr.c +1 -1
index 88458fa..05266b5 100644
@@ -46,7 +46,7 @@ static struct class *msr_class;
 static loff_t msr_seek(struct file *file, loff_t offset, int orig)
 {
 	loff_t ret;
-	struct inode *inode = file->f_mapping->host;
+	struct inode *inode = file_inode(file);
 
 	mutex_lock(&inode->i_mutex);
 	switch (orig) {