projects
/
cascardo
/
linux.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge tag 'gcc-plugins-v4.9-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git...
[cascardo/linux.git]
/
fs
/
ubifs
/
dir.c
diff --git
a/fs/ubifs/dir.c
b/fs/ubifs/dir.c
index
c8f60df
..
ca16c5d
100644
(file)
--- a/
fs/ubifs/dir.c
+++ b/
fs/ubifs/dir.c
@@
-439,7
+439,7
@@
static unsigned int vfs_dent_type(uint8_t type)
*/
static int ubifs_readdir(struct file *file, struct dir_context *ctx)
{
*/
static int ubifs_readdir(struct file *file, struct dir_context *ctx)
{
- int err;
+ int err
= 0
;
struct qstr nm;
union ubifs_key key;
struct ubifs_dent_node *dent;
struct qstr nm;
union ubifs_key key;
struct ubifs_dent_node *dent;
@@
-541,14
+541,20
@@
out:
kfree(file->private_data);
file->private_data = NULL;
kfree(file->private_data);
file->private_data = NULL;
- if (err != -ENOENT)
{
+ if (err != -ENOENT)
ubifs_err(c, "cannot find next direntry, error %d", err);
ubifs_err(c, "cannot find next direntry, error %d", err);
- return err;
- }
+ else
+ /*
+ * -ENOENT is a non-fatal error in this context, the TNC uses
+ * it to indicate that the cursor moved past the current directory
+ * and readdir() has to stop.
+ */
+ err = 0;
+
/* 2 is a special value indicating that there are no more direntries */
ctx->pos = 2;
/* 2 is a special value indicating that there are no more direntries */
ctx->pos = 2;
- return
0
;
+ return
err
;
}
/* Free saved readdir() state when the directory is closed */
}
/* Free saved readdir() state when the directory is closed */
@@
-1060,9
+1066,9
@@
static void unlock_4_inodes(struct inode *inode1, struct inode *inode2,
mutex_unlock(&ubifs_inode(inode1)->ui_mutex);
}
mutex_unlock(&ubifs_inode(inode1)->ui_mutex);
}
-static int
ubifs
_rename(struct inode *old_dir, struct dentry *old_dentry,
-
struct inode *new_dir, struct dentry *new_dentry,
-
unsigned int flags)
+static int
do
_rename(struct inode *old_dir, struct dentry *old_dentry,
+ struct inode *new_dir, struct dentry *new_dentry,
+ unsigned int flags)
{
struct ubifs_info *c = old_dir->i_sb->s_fs_info;
struct inode *old_inode = d_inode(old_dentry);
{
struct ubifs_info *c = old_dir->i_sb->s_fs_info;
struct inode *old_inode = d_inode(old_dentry);
@@
-1323,7
+1329,7
@@
static int ubifs_xrename(struct inode *old_dir, struct dentry *old_dentry,
return err;
}
return err;
}
-static int ubifs_rename
2
(struct inode *old_dir, struct dentry *old_dentry,
+static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,
struct inode *new_dir, struct dentry *new_dentry,
unsigned int flags)
{
struct inode *new_dir, struct dentry *new_dentry,
unsigned int flags)
{
@@
-1336,7
+1342,7
@@
static int ubifs_rename2(struct inode *old_dir, struct dentry *old_dentry,
if (flags & RENAME_EXCHANGE)
return ubifs_xrename(old_dir, old_dentry, new_dir, new_dentry);
if (flags & RENAME_EXCHANGE)
return ubifs_xrename(old_dir, old_dentry, new_dir, new_dentry);
- return
ubifs
_rename(old_dir, old_dentry, new_dir, new_dentry, flags);
+ return
do
_rename(old_dir, old_dentry, new_dir, new_dentry, flags);
}
int ubifs_getattr(struct vfsmount *mnt, struct dentry *dentry,
}
int ubifs_getattr(struct vfsmount *mnt, struct dentry *dentry,
@@
-1387,7
+1393,7
@@
const struct inode_operations ubifs_dir_inode_operations = {
.mkdir = ubifs_mkdir,
.rmdir = ubifs_rmdir,
.mknod = ubifs_mknod,
.mkdir = ubifs_mkdir,
.rmdir = ubifs_rmdir,
.mknod = ubifs_mknod,
- .rename = ubifs_rename
2
,
+ .rename = ubifs_rename,
.setattr = ubifs_setattr,
.getattr = ubifs_getattr,
.listxattr = ubifs_listxattr,
.setattr = ubifs_setattr,
.getattr = ubifs_getattr,
.listxattr = ubifs_listxattr,