aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/cifs/file.c23
-rw-r--r--fs/compat.c20
-rw-r--r--fs/ecryptfs/crypto.c2
-rw-r--r--fs/fuse/file.c9
-rw-r--r--fs/gfs2/ops_address.c7
-rw-r--r--fs/nfsd/nfs4recover.c2
-rw-r--r--fs/reiserfs/super.c1
-rw-r--r--fs/xattr.c13
8 files changed, 34 insertions, 43 deletions
diff --git a/fs/cifs/file.c b/fs/cifs/file.c
index 976a691c5a68..7e056b9b49e8 100644
--- a/fs/cifs/file.c
+++ b/fs/cifs/file.c
@@ -1806,13 +1806,6 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
1806 } 1806 }
1807 if ((rc < 0) || (smb_read_data == NULL)) { 1807 if ((rc < 0) || (smb_read_data == NULL)) {
1808 cFYI(1, ("Read error in readpages: %d", rc)); 1808 cFYI(1, ("Read error in readpages: %d", rc));
1809 /* clean up remaing pages off list */
1810 while (!list_empty(page_list) && (i < num_pages)) {
1811 page = list_entry(page_list->prev, struct page,
1812 lru);
1813 list_del(&page->lru);
1814 page_cache_release(page);
1815 }
1816 break; 1809 break;
1817 } else if (bytes_read > 0) { 1810 } else if (bytes_read > 0) {
1818 pSMBr = (struct smb_com_read_rsp *)smb_read_data; 1811 pSMBr = (struct smb_com_read_rsp *)smb_read_data;
@@ -1831,13 +1824,7 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
1831 this case is ok - if we are at server EOF 1824 this case is ok - if we are at server EOF
1832 we will hit it on next read */ 1825 we will hit it on next read */
1833 1826
1834 /* while (!list_empty(page_list) && (i < num_pages)) { 1827 /* break; */
1835 page = list_entry(page_list->prev,
1836 struct page, list);
1837 list_del(&page->list);
1838 page_cache_release(page);
1839 }
1840 break; */
1841 } 1828 }
1842 } else { 1829 } else {
1843 cFYI(1, ("No bytes read (%d) at offset %lld . " 1830 cFYI(1, ("No bytes read (%d) at offset %lld . "
@@ -1845,14 +1832,6 @@ static int cifs_readpages(struct file *file, struct address_space *mapping,
1845 bytes_read, offset)); 1832 bytes_read, offset));
1846 /* BB turn off caching and do new lookup on 1833 /* BB turn off caching and do new lookup on
1847 file size at server? */ 1834 file size at server? */
1848 while (!list_empty(page_list) && (i < num_pages)) {
1849 page = list_entry(page_list->prev, struct page,
1850 lru);
1851 list_del(&page->lru);
1852
1853 /* BB removeme - replace with zero of page? */
1854 page_cache_release(page);
1855 }
1856 break; 1835 break;
1857 } 1836 }
1858 if (smb_read_data) { 1837 if (smb_read_data) {
diff --git a/fs/compat.c b/fs/compat.c
index 50624d4a70c6..8d0a0018a7d2 100644
--- a/fs/compat.c
+++ b/fs/compat.c
@@ -1835,9 +1835,12 @@ asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp,
1835 1835
1836 } while (!ret && !timeout && tsp && (ts.tv_sec || ts.tv_nsec)); 1836 } while (!ret && !timeout && tsp && (ts.tv_sec || ts.tv_nsec));
1837 1837
1838 if (ret == 0 && tsp && !(current->personality & STICKY_TIMEOUTS)) { 1838 if (tsp) {
1839 struct compat_timespec rts; 1839 struct compat_timespec rts;
1840 1840
1841 if (current->personality & STICKY_TIMEOUTS)
1842 goto sticky;
1843
1841 rts.tv_sec = timeout / HZ; 1844 rts.tv_sec = timeout / HZ;
1842 rts.tv_nsec = (timeout % HZ) * (NSEC_PER_SEC/HZ); 1845 rts.tv_nsec = (timeout % HZ) * (NSEC_PER_SEC/HZ);
1843 if (rts.tv_nsec >= NSEC_PER_SEC) { 1846 if (rts.tv_nsec >= NSEC_PER_SEC) {
@@ -1846,8 +1849,19 @@ asmlinkage long compat_sys_pselect7(int n, compat_ulong_t __user *inp,
1846 } 1849 }
1847 if (compat_timespec_compare(&rts, &ts) >= 0) 1850 if (compat_timespec_compare(&rts, &ts) >= 0)
1848 rts = ts; 1851 rts = ts;
1849 if (copy_to_user(tsp, &rts, sizeof(rts))) 1852 if (copy_to_user(tsp, &rts, sizeof(rts))) {
1850 ret = -EFAULT; 1853sticky:
1854 /*
1855 * If an application puts its timeval in read-only
1856 * memory, we don't want the Linux-specific update to
1857 * the timeval to cause a fault after the select has
1858 * completed successfully. However, because we're not
1859 * updating the timeval, we can't restart the system
1860 * call.
1861 */
1862 if (ret == -ERESTARTNOHAND)
1863 ret = -EINTR;
1864 }
1851 } 1865 }
1852 1866
1853 if (ret == -ERESTARTNOHAND) { 1867 if (ret == -ERESTARTNOHAND) {
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index f49f105394b7..136175a69332 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -134,7 +134,7 @@ int ecryptfs_crypto_api_algify_cipher_name(char **algified_name,
134 134
135 algified_name_len = (chaining_modifier_len + cipher_name_len + 3); 135 algified_name_len = (chaining_modifier_len + cipher_name_len + 3);
136 (*algified_name) = kmalloc(algified_name_len, GFP_KERNEL); 136 (*algified_name) = kmalloc(algified_name_len, GFP_KERNEL);
137 if (!(algified_name)) { 137 if (!(*algified_name)) {
138 rc = -ENOMEM; 138 rc = -ENOMEM;
139 goto out; 139 goto out;
140 } 140 }
diff --git a/fs/fuse/file.c b/fs/fuse/file.c
index 2bb5ace3882d..763a50daf1c0 100644
--- a/fs/fuse/file.c
+++ b/fs/fuse/file.c
@@ -397,14 +397,14 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
397 397
398 err = -EIO; 398 err = -EIO;
399 if (is_bad_inode(inode)) 399 if (is_bad_inode(inode))
400 goto clean_pages_up; 400 goto out;
401 401
402 data.file = file; 402 data.file = file;
403 data.inode = inode; 403 data.inode = inode;
404 data.req = fuse_get_req(fc); 404 data.req = fuse_get_req(fc);
405 err = PTR_ERR(data.req); 405 err = PTR_ERR(data.req);
406 if (IS_ERR(data.req)) 406 if (IS_ERR(data.req))
407 goto clean_pages_up; 407 goto out;
408 408
409 err = read_cache_pages(mapping, pages, fuse_readpages_fill, &data); 409 err = read_cache_pages(mapping, pages, fuse_readpages_fill, &data);
410 if (!err) { 410 if (!err) {
@@ -413,10 +413,7 @@ static int fuse_readpages(struct file *file, struct address_space *mapping,
413 else 413 else
414 fuse_put_request(fc, data.req); 414 fuse_put_request(fc, data.req);
415 } 415 }
416 return err; 416out:
417
418clean_pages_up:
419 put_pages_list(pages);
420 return err; 417 return err;
421} 418}
422 419
diff --git a/fs/gfs2/ops_address.c b/fs/gfs2/ops_address.c
index 8d5963c7e123..015640b3f123 100644
--- a/fs/gfs2/ops_address.c
+++ b/fs/gfs2/ops_address.c
@@ -337,13 +337,6 @@ out:
337out_noerror: 337out_noerror:
338 ret = 0; 338 ret = 0;
339out_unlock: 339out_unlock:
340 /* unlock all pages, we can't do any I/O right now */
341 for (page_idx = 0; page_idx < nr_pages; page_idx++) {
342 struct page *page = list_entry(pages->prev, struct page, lru);
343 list_del(&page->lru);
344 unlock_page(page);
345 page_cache_release(page);
346 }
347 if (do_unlock) 340 if (do_unlock)
348 gfs2_holder_uninit(&gh); 341 gfs2_holder_uninit(&gh);
349 goto out; 342 goto out;
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c
index e9d07704680e..81b8565d3837 100644
--- a/fs/nfsd/nfs4recover.c
+++ b/fs/nfsd/nfs4recover.c
@@ -274,7 +274,7 @@ nfsd4_clear_clid_dir(struct dentry *dir, struct dentry *dentry)
274 * any regular files anyway, just in case the directory was created by 274 * any regular files anyway, just in case the directory was created by
275 * a kernel from the future.... */ 275 * a kernel from the future.... */
276 nfsd4_list_rec_dir(dentry, nfsd4_remove_clid_file); 276 nfsd4_list_rec_dir(dentry, nfsd4_remove_clid_file);
277 mutex_lock(&dir->d_inode->i_mutex); 277 mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT);
278 status = vfs_rmdir(dir->d_inode, dentry); 278 status = vfs_rmdir(dir->d_inode, dentry);
279 mutex_unlock(&dir->d_inode->i_mutex); 279 mutex_unlock(&dir->d_inode->i_mutex);
280 return status; 280 return status;
diff --git a/fs/reiserfs/super.c b/fs/reiserfs/super.c
index 9041802df832..17249994110f 100644
--- a/fs/reiserfs/super.c
+++ b/fs/reiserfs/super.c
@@ -1619,6 +1619,7 @@ static int reiserfs_fill_super(struct super_block *s, void *data, int silent)
1619 "jmacd-8: reiserfs_fill_super: unable to read bitmap"); 1619 "jmacd-8: reiserfs_fill_super: unable to read bitmap");
1620 goto error; 1620 goto error;
1621 } 1621 }
1622 errval = -EINVAL;
1622#ifdef CONFIG_REISERFS_CHECK 1623#ifdef CONFIG_REISERFS_CHECK
1623 SWARN(silent, s, "CONFIG_REISERFS_CHECK is set ON"); 1624 SWARN(silent, s, "CONFIG_REISERFS_CHECK is set ON");
1624 SWARN(silent, s, "- it is slow mode for debugging."); 1625 SWARN(silent, s, "- it is slow mode for debugging.");
diff --git a/fs/xattr.c b/fs/xattr.c
index 395635100f77..0901bdc2ce24 100644
--- a/fs/xattr.c
+++ b/fs/xattr.c
@@ -48,14 +48,21 @@ xattr_permission(struct inode *inode, const char *name, int mask)
48 return 0; 48 return 0;
49 49
50 /* 50 /*
51 * The trusted.* namespace can only accessed by a privilegued user. 51 * The trusted.* namespace can only be accessed by a privileged user.
52 */ 52 */
53 if (!strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN)) 53 if (!strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN))
54 return (capable(CAP_SYS_ADMIN) ? 0 : -EPERM); 54 return (capable(CAP_SYS_ADMIN) ? 0 : -EPERM);
55 55
56 /* In user.* namespace, only regular files and directories can have
57 * extended attributes. For sticky directories, only the owner and
58 * privileged user can write attributes.
59 */
56 if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) { 60 if (!strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN)) {
57 if (!S_ISREG(inode->i_mode) && 61 if (!S_ISREG(inode->i_mode) && !S_ISDIR(inode->i_mode))
58 (!S_ISDIR(inode->i_mode) || inode->i_mode & S_ISVTX)) 62 return -EPERM;
63 if (S_ISDIR(inode->i_mode) && (inode->i_mode & S_ISVTX) &&
64 (mask & MAY_WRITE) && (current->fsuid != inode->i_uid) &&
65 !capable(CAP_FOWNER))
59 return -EPERM; 66 return -EPERM;
60 } 67 }
61 68