mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 03:27:44 -04:00
[PATCH] f_count may wrap around
make it atomic_long_t; while we are at it, get rid of useless checks in affs, hfs and hpfs - ->open() always has it equal to 1, ->release() - to 0. Signed-off-by: Al Viro <[email protected]>
This commit is contained in:
parent
3c333937ee
commit
516e0cc564
11 changed files with 27 additions and 39 deletions
6
fs/aio.c
6
fs/aio.c
|
|
@ -512,8 +512,8 @@ static void aio_fput_routine(struct work_struct *data)
|
|||
*/
|
||||
static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
|
||||
{
|
||||
dprintk(KERN_DEBUG "aio_put(%p): f_count=%d\n",
|
||||
req, atomic_read(&req->ki_filp->f_count));
|
||||
dprintk(KERN_DEBUG "aio_put(%p): f_count=%ld\n",
|
||||
req, atomic_long_read(&req->ki_filp->f_count));
|
||||
|
||||
assert_spin_locked(&ctx->ctx_lock);
|
||||
|
||||
|
|
@ -528,7 +528,7 @@ static int __aio_put_req(struct kioctx *ctx, struct kiocb *req)
|
|||
/* Must be done under the lock to serialise against cancellation.
|
||||
* Call this aio_fput as it duplicates fput via the fput_work.
|
||||
*/
|
||||
if (unlikely(atomic_dec_and_test(&req->ki_filp->f_count))) {
|
||||
if (unlikely(atomic_long_dec_and_test(&req->ki_filp->f_count))) {
|
||||
get_ioctx(ctx);
|
||||
spin_lock(&fput_lock);
|
||||
list_add(&req->ki_list, &fput_head);
|
||||
|
|
|
|||
Loading…
Reference in a new issue