Bugzilla – Attachment 48974 Details for
Bug 114875
Subfs mount points have wrong st_dev
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
cache stat data from subfs sub-mount's root dir
subfs-cache-stat-data.diff (text/plain), 2.61 KB, created by
Jeff Mahoney
on 2005-09-06 17:06:22 UTC
(
hide
)
Description:
cache stat data from subfs sub-mount's root dir
Filename:
MIME Type:
Creator:
Jeff Mahoney
Created:
2005-09-06 17:06:22 UTC
Size:
2.61 KB
patch
obsolete
>diff -ruNpX dontdiff linux-2.6.13/fs/subfs/subfs.c linux-2.6.13.fixed/fs/subfs/subfs.c >--- linux-2.6.13/fs/subfs/subfs.c 2005-09-05 23:58:22.000000000 -0400 >+++ linux-2.6.13.fixed/fs/subfs/subfs.c 2005-09-06 15:00:52.000000000 -0400 >@@ -43,6 +43,7 @@ struct subfs_mount { > struct super_block *sb; > struct semaphore sem; > int procuid; >+ struct kstat stat; > }; > > /* Same as set_fs_pwd from namespace.c. There's a problem with the >@@ -163,6 +164,8 @@ static struct vfsmount *get_child_mount > if (mnt->mnt_mountpoint == mnt->mnt_root) { > printk (KERN_ERR "subfs: refusing to mount media in " > "deleted directory\n"); >+ generic_fillattr(sfs_mnt->sb->s_root->d_inode, &sfs_mnt->stat); >+ > return ERR_PTR(-ENOENT); > } > >@@ -179,6 +182,9 @@ static struct vfsmount *get_child_mount > printk (KERN_ERR "subfs: unsuccessful attempt to " > "mount media (%d)\n", result); > /* Workaround for call_usermodehelper return value bug. */ >+ generic_fillattr(sfs_mnt->sb->s_root->d_inode, >+ &sfs_mnt->stat); >+ > if (result < 0) > return ERR_PTR(result); > return ERR_PTR(-ENOMEDIUM); >@@ -190,9 +196,16 @@ static struct vfsmount *get_child_mount > * it was umounted already. Tell the process to retry. > */ > if (!child) { >+ generic_fillattr(sfs_mnt->sb->s_root->d_inode, >+ &sfs_mnt->stat); > subfs_send_signal(); > return ERR_PTR(-ERESTARTSYS); > } >+ result = vfs_getattr(child, child->mnt_root, &sfs_mnt->stat); >+ if (result) { >+ mntput(child); >+ return ERR_PTR(result); >+ } > } > > return child; >@@ -281,6 +294,15 @@ static int subfs_statfs(struct super_blo > #endif > } > >+static int subfs_getattr(struct vfsmount *mnt, struct dentry *dentry, >+ struct kstat *stat) >+{ >+ struct subfs_mount *sfs_mnt = mnt->mnt_sb->s_fs_info; >+ *stat = sfs_mnt->stat; >+ return 0; >+} >+ >+ > static struct super_operations subfs_s_ops = { > .statfs = subfs_statfs, > .drop_inode = generic_delete_inode, >@@ -289,6 +311,7 @@ static struct super_operations subfs_s_o > > static struct inode_operations subfs_dir_inode_operations = { > .lookup = subfs_lookup, >+ .getattr = subfs_getattr, > }; > > >@@ -310,6 +333,7 @@ static struct inode *subfs_make_inode(st > ret->i_blocks = 0; > ret->i_atime = ret->i_mtime = ret->i_ctime = CURRENT_TIME; > ret->i_fop = &subfs_file_ops; >+ ret->i_nlink = 2; > } > return ret; > } >@@ -444,6 +468,7 @@ static struct super_block *subfs_get_sup > return ERR_PTR(ret); > newmount->sb = get_sb_nodev(fst, flags, data, subfs_fill_super); > newmount->sb->s_fs_info = newmount; >+ generic_fillattr(newmount->sb->s_root->d_inode, &newmount->stat); > return newmount->sb; > } >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 114875
:
48869
| 48974