diff options
author | Fabian Frederick <fabf@skynet.be> | 2017-04-23 20:58:34 +0200 |
---|---|---|
committer | Jan Kara <jack@suse.cz> | 2017-04-24 16:28:02 +0200 |
commit | 5c26eac43a0b708083ebd99e0ba57c9b268cef84 (patch) | |
tree | e9a0ed9341c465afd48bec233c3cad499a37b847 /fs/udf/inode.c | |
parent | 6ff6b2b32924d53519948e270cb9f5549408c039 (diff) | |
download | linux-stable-5c26eac43a0b708083ebd99e0ba57c9b268cef84.tar.gz linux-stable-5c26eac43a0b708083ebd99e0ba57c9b268cef84.tar.bz2 linux-stable-5c26eac43a0b708083ebd99e0ba57c9b268cef84.zip |
udf: use kmap_atomic for memcpy copying
Use temporary mapping for memory copying operations.
To avoid any sleeping problem,
mark_inode_dirty(inode) was moved after kunmap() in
udf_adinicb_readpage()
down_write(&iinfo->i_data_sem) set before kmap_atomic()
in udf_expand_file_adinicb()
Signed-off-by: Fabian Frederick <fabf@skynet.be>
Signed-off-by: Jan Kara <jack@suse.cz>
Diffstat (limited to 'fs/udf/inode.c')
-rw-r--r-- | fs/udf/inode.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/fs/udf/inode.c b/fs/udf/inode.c index 8715dcd11596..98c510e17203 100644 --- a/fs/udf/inode.c +++ b/fs/udf/inode.c @@ -276,14 +276,14 @@ int udf_expand_file_adinicb(struct inode *inode) return -ENOMEM; if (!PageUptodate(page)) { - kaddr = kmap(page); + kaddr = kmap_atomic(page); memset(kaddr + iinfo->i_lenAlloc, 0x00, PAGE_SIZE - iinfo->i_lenAlloc); memcpy(kaddr, iinfo->i_ext.i_data + iinfo->i_lenEAttr, iinfo->i_lenAlloc); flush_dcache_page(page); SetPageUptodate(page); - kunmap(page); + kunmap_atomic(kaddr); } down_write(&iinfo->i_data_sem); memset(iinfo->i_ext.i_data + iinfo->i_lenEAttr, 0x00, @@ -300,11 +300,11 @@ int udf_expand_file_adinicb(struct inode *inode) if (err) { /* Restore everything back so that we don't lose data... */ lock_page(page); - kaddr = kmap(page); down_write(&iinfo->i_data_sem); + kaddr = kmap_atomic(page); memcpy(iinfo->i_ext.i_data + iinfo->i_lenEAttr, kaddr, inode->i_size); - kunmap(page); + kunmap_atomic(kaddr); unlock_page(page); iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB; inode->i_data.a_ops = &udf_adinicb_aops; |