Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 826289 Details for
Bug 1003546
NFS + large XFS fs sometimes fails uncached lookups for client when inode number >2^32 on 32-bit computers
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
backport of upstream submission
TMP (text/plain), 3.69 KB, created by
J. Bruce Fields
on 2013-11-19 20:39:32 UTC
(
hide
)
Description:
backport of upstream submission
Filename:
MIME Type:
Creator:
J. Bruce Fields
Created:
2013-11-19 20:39:32 UTC
Size:
3.69 KB
patch
obsolete
>diff --git a/fs/exportfs/expfs.c b/fs/exportfs/expfs.c >index 262fc99..6318ed7 100644 >--- a/fs/exportfs/expfs.c >+++ b/fs/exportfs/expfs.c >@@ -214,7 +214,7 @@ reconnect_path(struct vfsmount *mnt, struct dentry *target_dir, char *nbuf) > struct getdents_callback { > char *name; /* name that was found. It already points to a > buffer NAME_MAX+1 is size */ >- unsigned long ino; /* the inum we are looking for */ >+ u64 ino; /* the inum we are looking for */ > int found; /* inode matched? */ > int sequence; /* sequence counter */ > }; >@@ -255,6 +255,11 @@ static int get_name(const struct path *path, char *name, struct dentry *child) > int error; > struct file *file; > struct getdents_callback buffer; >+ struct kstat stat; >+ struct path child_path = { >+ .mnt = path->mnt, >+ .dentry = child, >+ }; > > error = -ENOTDIR; > if (!dir || !S_ISDIR(dir->i_mode)) >@@ -263,6 +268,16 @@ static int get_name(const struct path *path, char *name, struct dentry *child) > if (!dir->i_fop) > goto out; > /* >+ * inode->i_ino is unsigned long, kstat->ino is u64, so the >+ * former would be insufficient on 32-bit hosts when the >+ * filesystem supports 64-bit inode numbers. So we need to >+ * actually call ->getattr, not just read i_ino: >+ */ >+ error = vfs_getattr_nosec(&child_path, &stat); >+ if (error) >+ return error; >+ buffer.ino = stat.ino; >+ /* > * Open the directory ... > */ > file = dentry_open(path, O_RDONLY, cred); >@@ -275,7 +290,6 @@ static int get_name(const struct path *path, char *name, struct dentry *child) > goto out_close; > > buffer.name = name; >- buffer.ino = child->d_inode->i_ino; > buffer.found = 0; > buffer.sequence = 0; > while (1) { >diff --git a/fs/stat.c b/fs/stat.c >index 04ce1ac..a89473f 100644 >--- a/fs/stat.c >+++ b/fs/stat.c >@@ -37,14 +37,21 @@ void generic_fillattr(struct inode *inode, struct kstat *stat) > > EXPORT_SYMBOL(generic_fillattr); > >-int vfs_getattr(struct path *path, struct kstat *stat) >+/** >+ * vfs_getattr_nosec - getattr without security checks >+ * @path: file to get attributes from >+ * @stat: structure to return attributes in >+ * >+ * Get attributes without calling security_inode_getattr. >+ * >+ * Currently the only caller other than vfs_getattr is internal to the >+ * filehandle lookup code, which uses only the inode number and returns >+ * no attributes to any user. Any other code probably wants >+ * vfs_getattr. >+ */ >+int vfs_getattr_nosec(struct path *path, struct kstat *stat) > { > struct inode *inode = path->dentry->d_inode; >- int retval; >- >- retval = security_inode_getattr(path->mnt, path->dentry); >- if (retval) >- return retval; > > if (inode->i_op->getattr) > return inode->i_op->getattr(path->mnt, path->dentry, stat); >@@ -53,6 +60,18 @@ int vfs_getattr(struct path *path, struct kstat *stat) > return 0; > } > >+EXPORT_SYMBOL(vfs_getattr_nosec); >+ >+int vfs_getattr(struct path *path, struct kstat *stat) >+{ >+ int retval; >+ >+ retval = security_inode_getattr(path->mnt, path->dentry); >+ if (retval) >+ return retval; >+ return vfs_getattr_nosec(path, stat); >+} >+ > EXPORT_SYMBOL(vfs_getattr); > > int vfs_fstat(unsigned int fd, struct kstat *stat) >diff --git a/include/linux/fs.h b/include/linux/fs.h >index 65c2be2..a66624c 100644 >--- a/include/linux/fs.h >+++ b/include/linux/fs.h >@@ -2486,6 +2486,7 @@ extern int page_symlink(struct inode *inode, const char *symname, int len); > extern const struct inode_operations page_symlink_inode_operations; > extern int generic_readlink(struct dentry *, char __user *, int); > extern void generic_fillattr(struct inode *, struct kstat *); >+int vfs_getattr_nosec(struct path *path, struct kstat *stat); > extern int vfs_getattr(struct path *, struct kstat *); > void __inode_add_bytes(struct inode *inode, loff_t bytes); > void inode_add_bytes(struct inode *inode, loff_t bytes);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1003546
:
793579
|
793580
|
793581
|
793582
|
794600
|
794955
|
796070
|
798881
|
803897
| 826289 |
832896
|
832897