X-Git-Url: https://git.stricted.de/?a=blobdiff_plain;f=kernel%2Facct.c;h=8d6e145138bb9d2e39e93933177f63536d73d018;hb=5ae98f1589e076e4b314fc54ae2beac58842ddc2;hp=b9bd7f098ee5d17fc8fa41bb823b80e0b94df3d6;hpb=d608d71cd6d19792487d08333d63c7ff20294694;p=GitHub%2Fmt8127%2Fandroid_kernel_alcatel_ttab.git diff --git a/kernel/acct.c b/kernel/acct.c index b9bd7f098ee5..8d6e145138bb 100644 --- a/kernel/acct.c +++ b/kernel/acct.c @@ -539,6 +539,12 @@ static void do_acct_process(struct bsd_acct_struct *acct, ac.ac_rw = encode_comp_t(ac.ac_io / 1024); ac.ac_swaps = encode_comp_t(0); + /* + * Get freeze protection. If the fs is frozen, just skip the write + * as we could deadlock the system otherwise. + */ + if (!file_start_write_trylock(file)) + goto out; /* * Kernel segment override to datasegment and write it * to the accounting file. @@ -554,6 +560,7 @@ static void do_acct_process(struct bsd_acct_struct *acct, sizeof(acct_t), &file->f_pos); current->signal->rlim[RLIMIT_FSIZE].rlim_cur = flim; set_fs(fs); + file_end_write(file); out: revert_creds(orig_cred); }