提交 522440ed 编写于 作者: J Jeff Layton 提交者: Steve French

cifs: set backing_dev_info on new S_ISREG inodes

Testing on very recent kernel (2.6.36-rc6) made this warning pop:

    WARNING: at fs/fs-writeback.c:87 inode_to_bdi+0x65/0x70()
    Hardware name:
    Dirtiable inode bdi default != sb bdi cifs

...the following patch fixes it and seems to be the obviously correct
thing to do for cifs.

Cc: stable@kernel.org
Acked-by: NDave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: NJeff Layton <jlayton@redhat.com>
Signed-off-by: NSteve French <sfrench@us.ibm.com>
上级 899611ee
...@@ -801,6 +801,8 @@ cifs_iget(struct super_block *sb, struct cifs_fattr *fattr) ...@@ -801,6 +801,8 @@ cifs_iget(struct super_block *sb, struct cifs_fattr *fattr)
inode->i_flags |= S_NOATIME | S_NOCMTIME; inode->i_flags |= S_NOATIME | S_NOCMTIME;
if (inode->i_state & I_NEW) { if (inode->i_state & I_NEW) {
inode->i_ino = hash; inode->i_ino = hash;
if (S_ISREG(inode->i_mode))
inode->i_data.backing_dev_info = sb->s_bdi;
#ifdef CONFIG_CIFS_FSCACHE #ifdef CONFIG_CIFS_FSCACHE
/* initialize per-inode cache cookie pointer */ /* initialize per-inode cache cookie pointer */
CIFS_I(inode)->fscache = NULL; CIFS_I(inode)->fscache = NULL;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册