Re: Regression caused by using node_to_bdi()

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

 



On 04/13/2015 01:22 PM, Zhao Lei wrote:
<>
> A new bad news:
> This patch make filesystem unstable.
> 

Rrrr yes sorry Lei. Why this boots my systems is not clear this is not
what I intended to write.

Here is what I meant to write (replacing the old one):
----
diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
index 32a8bbd..e0375e1 100644
--- a/fs/fs-writeback.c
+++ b/fs/fs-writeback.c
@@ -78,7 +78,7 @@ int writeback_in_progress(struct backing_dev_info *bdi)
 }
 EXPORT_SYMBOL(writeback_in_progress);
 
-struct backing_dev_info *inode_to_bdi(struct inode *inode)
+struct backing_dev_info *__inode_to_bdi(struct inode *inode)
 {
 	struct super_block *sb;
 
@@ -92,7 +92,7 @@ struct backing_dev_info *inode_to_bdi(struct inode *inode)
 #endif
 	return sb->s_bdi;
 }
-EXPORT_SYMBOL_GPL(inode_to_bdi);
+EXPORT_SYMBOL_GPL(__inode_to_bdi);
 
 static inline struct inode *wb_inode(struct list_head *head)
 {
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index aff923a..53d97cd 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -107,7 +107,16 @@ struct backing_dev_info {
 #endif
 };
 
-struct backing_dev_info *inode_to_bdi(struct inode *inode);
+struct backing_dev_info *__inode_to_bdi(struct inode *inode);
+
+static inline
+struct backing_dev_info *inode_to_bdi(struct inode *inode)
+{
+	if (!inode || !inode->i_sb || !inode->i_sb->s_bdi)
+		return __inode_to_bdi(inode);
+
+	return inode->i_sb->s_bdi;
+}
 
 int __must_check bdi_init(struct backing_dev_info *bdi);
 void bdi_destroy(struct backing_dev_info *bdi);


--
To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux