aboutsummaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
Diffstat (limited to 'fs')
-rw-r--r--fs/Kconfig4
-rw-r--r--fs/aio.c6
-rw-r--r--fs/bio.c23
-rw-r--r--fs/debugfs/inode.c5
-rw-r--r--fs/ecryptfs/crypto.c3
-rw-r--r--fs/fuse/dir.c52
-rw-r--r--fs/jfs/jfs_filsys.h2
-rw-r--r--fs/proc/base.c3
-rw-r--r--fs/reiserfs/file.c3
-rw-r--r--fs/reiserfs/journal.c6
-rw-r--r--fs/xfs/xfs_bmap.c2
-rw-r--r--fs/xfs/xfs_inode.c2
12 files changed, 62 insertions, 49 deletions
diff --git a/fs/Kconfig b/fs/Kconfig
index 7b1511d50b05..b3b5aa0edff9 100644
--- a/fs/Kconfig
+++ b/fs/Kconfig
@@ -972,7 +972,7 @@ config SYSFS
972 972
973 Some system agents rely on the information in sysfs to operate. 973 Some system agents rely on the information in sysfs to operate.
974 /sbin/hotplug uses device and object attributes in sysfs to assist in 974 /sbin/hotplug uses device and object attributes in sysfs to assist in
975 delegating policy decisions, like persistantly naming devices. 975 delegating policy decisions, like persistently naming devices.
976 976
977 sysfs is currently used by the block subsystem to mount the root 977 sysfs is currently used by the block subsystem to mount the root
978 partition. If sysfs is disabled you must specify the boot device on 978 partition. If sysfs is disabled you must specify the boot device on
@@ -1145,7 +1145,7 @@ config BEFS_FS
1145 help 1145 help
1146 The BeOS File System (BeFS) is the native file system of Be, Inc's 1146 The BeOS File System (BeFS) is the native file system of Be, Inc's
1147 BeOS. Notable features include support for arbitrary attributes 1147 BeOS. Notable features include support for arbitrary attributes
1148 on files and directories, and database-like indeces on selected 1148 on files and directories, and database-like indices on selected
1149 attributes. (Also note that this driver doesn't make those features 1149 attributes. (Also note that this driver doesn't make those features
1150 available at this time). It is a 64 bit filesystem, so it supports 1150 available at this time). It is a 64 bit filesystem, so it supports
1151 extremely large volumes and files. 1151 extremely large volumes and files.
diff --git a/fs/aio.c b/fs/aio.c
index 94766599db00..277a5f2d18ad 100644
--- a/fs/aio.c
+++ b/fs/aio.c
@@ -367,8 +367,7 @@ void fastcall __put_ioctx(struct kioctx *ctx)
367{ 367{
368 unsigned nr_events = ctx->max_reqs; 368 unsigned nr_events = ctx->max_reqs;
369 369
370 if (unlikely(ctx->reqs_active)) 370 BUG_ON(ctx->reqs_active);
371 BUG();
372 371
373 cancel_delayed_work(&ctx->wq); 372 cancel_delayed_work(&ctx->wq);
374 flush_workqueue(aio_wq); 373 flush_workqueue(aio_wq);
@@ -505,8 +504,7 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
505 assert_spin_locked(&ctx->ctx_lock); 504 assert_spin_locked(&ctx->ctx_lock);
506 505
507 req->ki_users --; 506 req->ki_users --;
508 if (unlikely(req->ki_users < 0)) 507 BUG_ON(req->ki_users < 0);
509 BUG();
510 if (likely(req->ki_users)) 508 if (likely(req->ki_users))
511 return 0; 509 return 0;
512 list_del(&req->ki_list); /* remove from active_reqs */ 510 list_del(&req->ki_list); /* remove from active_reqs */
diff --git a/fs/bio.c b/fs/bio.c
index f95c8749499f..aa4d09bd4e71 100644
--- a/fs/bio.c
+++ b/fs/bio.c
@@ -560,10 +560,8 @@ struct bio *bio_copy_user(request_queue_t *q, unsigned long uaddr,
560 break; 560 break;
561 } 561 }
562 562
563 if (bio_add_pc_page(q, bio, page, bytes, 0) < bytes) { 563 if (bio_add_pc_page(q, bio, page, bytes, 0) < bytes)
564 ret = -EINVAL;
565 break; 564 break;
566 }
567 565
568 len -= bytes; 566 len -= bytes;
569 } 567 }
@@ -622,10 +620,9 @@ static struct bio *__bio_map_user_iov(request_queue_t *q,
622 620
623 nr_pages += end - start; 621 nr_pages += end - start;
624 /* 622 /*
625 * transfer and buffer must be aligned to at least hardsector 623 * buffer must be aligned to at least hardsector size for now
626 * size for now, in the future we can relax this restriction
627 */ 624 */
628 if ((uaddr & queue_dma_alignment(q)) || (len & queue_dma_alignment(q))) 625 if (uaddr & queue_dma_alignment(q))
629 return ERR_PTR(-EINVAL); 626 return ERR_PTR(-EINVAL);
630 } 627 }
631 628
@@ -751,7 +748,6 @@ struct bio *bio_map_user_iov(request_queue_t *q, struct block_device *bdev,
751 int write_to_vm) 748 int write_to_vm)
752{ 749{
753 struct bio *bio; 750 struct bio *bio;
754 int len = 0, i;
755 751
756 bio = __bio_map_user_iov(q, bdev, iov, iov_count, write_to_vm); 752 bio = __bio_map_user_iov(q, bdev, iov, iov_count, write_to_vm);
757 753
@@ -766,18 +762,7 @@ struct bio *bio_map_user_iov(request_queue_t *q, struct block_device *bdev,
766 */ 762 */
767 bio_get(bio); 763 bio_get(bio);
768 764
769 for (i = 0; i < iov_count; i++) 765 return bio;
770 len += iov[i].iov_len;
771
772 if (bio->bi_size == len)
773 return bio;
774
775 /*
776 * don't support partial mappings
777 */
778 bio_endio(bio, bio->bi_size, 0);
779 bio_unmap_user(bio);
780 return ERR_PTR(-EINVAL);
781} 766}
782 767
783static void __bio_unmap_user(struct bio *bio) 768static void __bio_unmap_user(struct bio *bio)
diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c
index e77676df6713..137d76c3f90a 100644
--- a/fs/debugfs/inode.c
+++ b/fs/debugfs/inode.c
@@ -21,6 +21,7 @@
21#include <linux/mount.h> 21#include <linux/mount.h>
22#include <linux/pagemap.h> 22#include <linux/pagemap.h>
23#include <linux/init.h> 23#include <linux/init.h>
24#include <linux/kobject.h>
24#include <linux/namei.h> 25#include <linux/namei.h>
25#include <linux/debugfs.h> 26#include <linux/debugfs.h>
26 27
@@ -147,13 +148,13 @@ static int debugfs_create_by_name(const char *name, mode_t mode,
147 *dentry = NULL; 148 *dentry = NULL;
148 mutex_lock(&parent->d_inode->i_mutex); 149 mutex_lock(&parent->d_inode->i_mutex);
149 *dentry = lookup_one_len(name, parent, strlen(name)); 150 *dentry = lookup_one_len(name, parent, strlen(name));
150 if (!IS_ERR(dentry)) { 151 if (!IS_ERR(*dentry)) {
151 if ((mode & S_IFMT) == S_IFDIR) 152 if ((mode & S_IFMT) == S_IFDIR)
152 error = debugfs_mkdir(parent->d_inode, *dentry, mode); 153 error = debugfs_mkdir(parent->d_inode, *dentry, mode);
153 else 154 else
154 error = debugfs_create(parent->d_inode, *dentry, mode); 155 error = debugfs_create(parent->d_inode, *dentry, mode);
155 } else 156 } else
156 error = PTR_ERR(dentry); 157 error = PTR_ERR(*dentry);
157 mutex_unlock(&parent->d_inode->i_mutex); 158 mutex_unlock(&parent->d_inode->i_mutex);
158 159
159 return error; 160 return error;
diff --git a/fs/ecryptfs/crypto.c b/fs/ecryptfs/crypto.c
index 136175a69332..f63a7755fe86 100644
--- a/fs/ecryptfs/crypto.c
+++ b/fs/ecryptfs/crypto.c
@@ -820,7 +820,8 @@ int ecryptfs_init_crypt_ctx(struct ecryptfs_crypt_stat *crypt_stat)
820 crypt_stat->tfm = crypto_alloc_blkcipher(full_alg_name, 0, 820 crypt_stat->tfm = crypto_alloc_blkcipher(full_alg_name, 0,
821 CRYPTO_ALG_ASYNC); 821 CRYPTO_ALG_ASYNC);
822 kfree(full_alg_name); 822 kfree(full_alg_name);
823 if (!crypt_stat->tfm) { 823 if (IS_ERR(crypt_stat->tfm)) {
824 rc = PTR_ERR(crypt_stat->tfm);
824 ecryptfs_printk(KERN_ERR, "cryptfs: init_crypt_ctx(): " 825 ecryptfs_printk(KERN_ERR, "cryptfs: init_crypt_ctx(): "
825 "Error initializing cipher [%s]\n", 826 "Error initializing cipher [%s]\n",
826 crypt_stat->cipher); 827 crypt_stat->cipher);
diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
index cfc8f81e60d0..c71a6c092ad9 100644
--- a/fs/fuse/dir.c
+++ b/fs/fuse/dir.c
@@ -138,6 +138,7 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
138 struct fuse_entry_out outarg; 138 struct fuse_entry_out outarg;
139 struct fuse_conn *fc; 139 struct fuse_conn *fc;
140 struct fuse_req *req; 140 struct fuse_req *req;
141 struct fuse_req *forget_req;
141 struct dentry *parent; 142 struct dentry *parent;
142 143
143 /* Doesn't hurt to "reset" the validity timeout */ 144 /* Doesn't hurt to "reset" the validity timeout */
@@ -152,25 +153,33 @@ static int fuse_dentry_revalidate(struct dentry *entry, struct nameidata *nd)
152 if (IS_ERR(req)) 153 if (IS_ERR(req))
153 return 0; 154 return 0;
154 155
156 forget_req = fuse_get_req(fc);
157 if (IS_ERR(forget_req)) {
158 fuse_put_request(fc, req);
159 return 0;
160 }
161
155 parent = dget_parent(entry); 162 parent = dget_parent(entry);
156 fuse_lookup_init(req, parent->d_inode, entry, &outarg); 163 fuse_lookup_init(req, parent->d_inode, entry, &outarg);
157 request_send(fc, req); 164 request_send(fc, req);
158 dput(parent); 165 dput(parent);
159 err = req->out.h.error; 166 err = req->out.h.error;
167 fuse_put_request(fc, req);
160 /* Zero nodeid is same as -ENOENT */ 168 /* Zero nodeid is same as -ENOENT */
161 if (!err && !outarg.nodeid) 169 if (!err && !outarg.nodeid)
162 err = -ENOENT; 170 err = -ENOENT;
163 if (!err) { 171 if (!err) {
164 struct fuse_inode *fi = get_fuse_inode(inode); 172 struct fuse_inode *fi = get_fuse_inode(inode);
165 if (outarg.nodeid != get_node_id(inode)) { 173 if (outarg.nodeid != get_node_id(inode)) {
166 fuse_send_forget(fc, req, outarg.nodeid, 1); 174 fuse_send_forget(fc, forget_req,
175 outarg.nodeid, 1);
167 return 0; 176 return 0;
168 } 177 }
169 spin_lock(&fc->lock); 178 spin_lock(&fc->lock);
170 fi->nlookup ++; 179 fi->nlookup ++;
171 spin_unlock(&fc->lock); 180 spin_unlock(&fc->lock);
172 } 181 }
173 fuse_put_request(fc, req); 182 fuse_put_request(fc, forget_req);
174 if (err || (outarg.attr.mode ^ inode->i_mode) & S_IFMT) 183 if (err || (outarg.attr.mode ^ inode->i_mode) & S_IFMT)
175 return 0; 184 return 0;
176 185
@@ -221,6 +230,7 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
221 struct inode *inode = NULL; 230 struct inode *inode = NULL;
222 struct fuse_conn *fc = get_fuse_conn(dir); 231 struct fuse_conn *fc = get_fuse_conn(dir);
223 struct fuse_req *req; 232 struct fuse_req *req;
233 struct fuse_req *forget_req;
224 234
225 if (entry->d_name.len > FUSE_NAME_MAX) 235 if (entry->d_name.len > FUSE_NAME_MAX)
226 return ERR_PTR(-ENAMETOOLONG); 236 return ERR_PTR(-ENAMETOOLONG);
@@ -229,9 +239,16 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
229 if (IS_ERR(req)) 239 if (IS_ERR(req))
230 return ERR_PTR(PTR_ERR(req)); 240 return ERR_PTR(PTR_ERR(req));
231 241
242 forget_req = fuse_get_req(fc);
243 if (IS_ERR(forget_req)) {
244 fuse_put_request(fc, req);
245 return ERR_PTR(PTR_ERR(forget_req));
246 }
247
232 fuse_lookup_init(req, dir, entry, &outarg); 248 fuse_lookup_init(req, dir, entry, &outarg);
233 request_send(fc, req); 249 request_send(fc, req);
234 err = req->out.h.error; 250 err = req->out.h.error;
251 fuse_put_request(fc, req);
235 /* Zero nodeid is same as -ENOENT, but with valid timeout */ 252 /* Zero nodeid is same as -ENOENT, but with valid timeout */
236 if (!err && outarg.nodeid && 253 if (!err && outarg.nodeid &&
237 (invalid_nodeid(outarg.nodeid) || !valid_mode(outarg.attr.mode))) 254 (invalid_nodeid(outarg.nodeid) || !valid_mode(outarg.attr.mode)))
@@ -240,11 +257,11 @@ static struct dentry *fuse_lookup(struct inode *dir, struct dentry *entry,
240 inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation, 257 inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation,
241 &outarg.attr); 258 &outarg.attr);
242 if (!inode) { 259 if (!inode) {
243 fuse_send_forget(fc, req, outarg.nodeid, 1); 260 fuse_send_forget(fc, forget_req, outarg.nodeid, 1);
244 return ERR_PTR(-ENOMEM); 261 return ERR_PTR(-ENOMEM);
245 } 262 }
246 } 263 }
247 fuse_put_request(fc, req); 264 fuse_put_request(fc, forget_req);
248 if (err && err != -ENOENT) 265 if (err && err != -ENOENT)
249 return ERR_PTR(err); 266 return ERR_PTR(err);
250 267
@@ -388,6 +405,13 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req,
388 struct fuse_entry_out outarg; 405 struct fuse_entry_out outarg;
389 struct inode *inode; 406 struct inode *inode;
390 int err; 407 int err;
408 struct fuse_req *forget_req;
409
410 forget_req = fuse_get_req(fc);
411 if (IS_ERR(forget_req)) {
412 fuse_put_request(fc, req);
413 return PTR_ERR(forget_req);
414 }
391 415
392 req->in.h.nodeid = get_node_id(dir); 416 req->in.h.nodeid = get_node_id(dir);
393 req->out.numargs = 1; 417 req->out.numargs = 1;
@@ -395,24 +419,24 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req,
395 req->out.args[0].value = &outarg; 419 req->out.args[0].value = &outarg;
396 request_send(fc, req); 420 request_send(fc, req);
397 err = req->out.h.error; 421 err = req->out.h.error;
398 if (err) { 422 fuse_put_request(fc, req);
399 fuse_put_request(fc, req); 423 if (err)
400 return err; 424 goto out_put_forget_req;
401 } 425
402 err = -EIO; 426 err = -EIO;
403 if (invalid_nodeid(outarg.nodeid)) 427 if (invalid_nodeid(outarg.nodeid))
404 goto out_put_request; 428 goto out_put_forget_req;
405 429
406 if ((outarg.attr.mode ^ mode) & S_IFMT) 430 if ((outarg.attr.mode ^ mode) & S_IFMT)
407 goto out_put_request; 431 goto out_put_forget_req;
408 432
409 inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation, 433 inode = fuse_iget(dir->i_sb, outarg.nodeid, outarg.generation,
410 &outarg.attr); 434 &outarg.attr);
411 if (!inode) { 435 if (!inode) {
412 fuse_send_forget(fc, req, outarg.nodeid, 1); 436 fuse_send_forget(fc, forget_req, outarg.nodeid, 1);
413 return -ENOMEM; 437 return -ENOMEM;
414 } 438 }
415 fuse_put_request(fc, req); 439 fuse_put_request(fc, forget_req);
416 440
417 if (S_ISDIR(inode->i_mode)) { 441 if (S_ISDIR(inode->i_mode)) {
418 struct dentry *alias; 442 struct dentry *alias;
@@ -434,8 +458,8 @@ static int create_new_entry(struct fuse_conn *fc, struct fuse_req *req,
434 fuse_invalidate_attr(dir); 458 fuse_invalidate_attr(dir);
435 return 0; 459 return 0;
436 460
437 out_put_request: 461 out_put_forget_req:
438 fuse_put_request(fc, req); 462 fuse_put_request(fc, forget_req);
439 return err; 463 return err;
440} 464}
441 465
diff --git a/fs/jfs/jfs_filsys.h b/fs/jfs/jfs_filsys.h
index 9901928668cf..eb550b339bb8 100644
--- a/fs/jfs/jfs_filsys.h
+++ b/fs/jfs/jfs_filsys.h
@@ -81,7 +81,7 @@
81#define JFS_SWAP_BYTES 0x00100000 /* running on big endian computer */ 81#define JFS_SWAP_BYTES 0x00100000 /* running on big endian computer */
82 82
83/* Directory index */ 83/* Directory index */
84#define JFS_DIR_INDEX 0x00200000 /* Persistant index for */ 84#define JFS_DIR_INDEX 0x00200000 /* Persistent index for */
85 /* directory entries */ 85 /* directory entries */
86 86
87 87
diff --git a/fs/proc/base.c b/fs/proc/base.c
index 8df27401d292..795319c54f72 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -442,7 +442,8 @@ static int mountstats_open(struct inode *inode, struct file *file)
442 442
443 if (task) { 443 if (task) {
444 task_lock(task); 444 task_lock(task);
445 namespace = task->nsproxy->namespace; 445 if (task->nsproxy)
446 namespace = task->nsproxy->namespace;
446 if (namespace) 447 if (namespace)
447 get_namespace(namespace); 448 get_namespace(namespace);
448 task_unlock(task); 449 task_unlock(task);
diff --git a/fs/reiserfs/file.c b/fs/reiserfs/file.c
index b67ce9354048..ac14318c81ba 100644
--- a/fs/reiserfs/file.c
+++ b/fs/reiserfs/file.c
@@ -74,7 +74,8 @@ static int reiserfs_file_release(struct inode *inode, struct file *filp)
74 igrab(inode); 74 igrab(inode);
75 reiserfs_warning(inode->i_sb, 75 reiserfs_warning(inode->i_sb,
76 "pinning inode %lu because the " 76 "pinning inode %lu because the "
77 "preallocation can't be freed"); 77 "preallocation can't be freed",
78 inode->i_ino);
78 goto out; 79 goto out;
79 } 80 }
80 } 81 }
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c
index 85ce23268302..ac93174c9639 100644
--- a/fs/reiserfs/journal.c
+++ b/fs/reiserfs/journal.c
@@ -1464,7 +1464,7 @@ static int flush_journal_list(struct super_block *s,
1464 } 1464 }
1465 1465
1466 /* if someone has this block in a newer transaction, just make 1466 /* if someone has this block in a newer transaction, just make
1467 ** sure they are commited, and don't try writing it to disk 1467 ** sure they are committed, and don't try writing it to disk
1468 */ 1468 */
1469 if (pjl) { 1469 if (pjl) {
1470 if (atomic_read(&pjl->j_commit_left)) 1470 if (atomic_read(&pjl->j_commit_left))
@@ -3384,7 +3384,7 @@ static int remove_from_transaction(struct super_block *p_s_sb,
3384 3384
3385/* 3385/*
3386** for any cnode in a journal list, it can only be dirtied of all the 3386** for any cnode in a journal list, it can only be dirtied of all the
3387** transactions that include it are commited to disk. 3387** transactions that include it are committed to disk.
3388** this checks through each transaction, and returns 1 if you are allowed to dirty, 3388** this checks through each transaction, and returns 1 if you are allowed to dirty,
3389** and 0 if you aren't 3389** and 0 if you aren't
3390** 3390**
@@ -3426,7 +3426,7 @@ static int can_dirty(struct reiserfs_journal_cnode *cn)
3426} 3426}
3427 3427
3428/* syncs the commit blocks, but does not force the real buffers to disk 3428/* syncs the commit blocks, but does not force the real buffers to disk
3429** will wait until the current transaction is done/commited before returning 3429** will wait until the current transaction is done/committed before returning
3430*/ 3430*/
3431int journal_end_sync(struct reiserfs_transaction_handle *th, 3431int journal_end_sync(struct reiserfs_transaction_handle *th,
3432 struct super_block *p_s_sb, unsigned long nblocks) 3432 struct super_block *p_s_sb, unsigned long nblocks)
diff --git a/fs/xfs/xfs_bmap.c b/fs/xfs/xfs_bmap.c
index 5b050c06795f..498ad50d1f45 100644
--- a/fs/xfs/xfs_bmap.c
+++ b/fs/xfs/xfs_bmap.c
@@ -1171,6 +1171,8 @@ xfs_bmap_add_extent_delay_real(
1171 xfs_bmap_trace_pre_update(fname, "0", ip, idx, XFS_DATA_FORK); 1171 xfs_bmap_trace_pre_update(fname, "0", ip, idx, XFS_DATA_FORK);
1172 xfs_bmbt_set_blockcount(ep, temp); 1172 xfs_bmbt_set_blockcount(ep, temp);
1173 r[0] = *new; 1173 r[0] = *new;
1174 r[1].br_state = PREV.br_state;
1175 r[1].br_startblock = 0;
1174 r[1].br_startoff = new_endoff; 1176 r[1].br_startoff = new_endoff;
1175 temp2 = PREV.br_startoff + PREV.br_blockcount - new_endoff; 1177 temp2 = PREV.br_startoff + PREV.br_blockcount - new_endoff;
1176 r[1].br_blockcount = temp2; 1178 r[1].br_blockcount = temp2;
diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
index d72c80dbfbb1..44dfac521285 100644
--- a/fs/xfs/xfs_inode.c
+++ b/fs/xfs/xfs_inode.c
@@ -2258,7 +2258,7 @@ xfs_ifree_cluster(
2258 AIL_LOCK(mp,s); 2258 AIL_LOCK(mp,s);
2259 iip->ili_flush_lsn = iip->ili_item.li_lsn; 2259 iip->ili_flush_lsn = iip->ili_item.li_lsn;
2260 AIL_UNLOCK(mp, s); 2260 AIL_UNLOCK(mp, s);
2261 xfs_iflags_set(ip, XFS_ISTALE); 2261 xfs_iflags_set(iip->ili_inode, XFS_ISTALE);
2262 pre_flushed++; 2262 pre_flushed++;
2263 } 2263 }
2264 lip = lip->li_bio_list; 2264 lip = lip->li_bio_list;