Commit c2b19fd7 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'fs_for_v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs

Pull udf and quota fixes from Jan Kara:
 "Fixes for crashes in UDF when inode expansion fails and one quota
  cleanup"

* tag 'fs_for_v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  quota: cleanup double word in comment
  udf: Restore i_lenAlloc when inode expansion fails
  udf: Fix NULL ptr deref when converting from inline format
parents 145d9b49 9daf0a4d
...@@ -258,10 +258,6 @@ int udf_expand_file_adinicb(struct inode *inode) ...@@ -258,10 +258,6 @@ int udf_expand_file_adinicb(struct inode *inode)
char *kaddr; char *kaddr;
struct udf_inode_info *iinfo = UDF_I(inode); struct udf_inode_info *iinfo = UDF_I(inode);
int err; int err;
struct writeback_control udf_wbc = {
.sync_mode = WB_SYNC_NONE,
.nr_to_write = 1,
};
WARN_ON_ONCE(!inode_is_locked(inode)); WARN_ON_ONCE(!inode_is_locked(inode));
if (!iinfo->i_lenAlloc) { if (!iinfo->i_lenAlloc) {
...@@ -305,8 +301,10 @@ int udf_expand_file_adinicb(struct inode *inode) ...@@ -305,8 +301,10 @@ int udf_expand_file_adinicb(struct inode *inode)
iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG; iinfo->i_alloc_type = ICBTAG_FLAG_AD_LONG;
/* from now on we have normal address_space methods */ /* from now on we have normal address_space methods */
inode->i_data.a_ops = &udf_aops; inode->i_data.a_ops = &udf_aops;
set_page_dirty(page);
unlock_page(page);
up_write(&iinfo->i_data_sem); up_write(&iinfo->i_data_sem);
err = inode->i_data.a_ops->writepage(page, &udf_wbc); err = filemap_fdatawrite(inode->i_mapping);
if (err) { if (err) {
/* Restore everything back so that we don't lose data... */ /* Restore everything back so that we don't lose data... */
lock_page(page); lock_page(page);
...@@ -317,6 +315,7 @@ int udf_expand_file_adinicb(struct inode *inode) ...@@ -317,6 +315,7 @@ int udf_expand_file_adinicb(struct inode *inode)
unlock_page(page); unlock_page(page);
iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB; iinfo->i_alloc_type = ICBTAG_FLAG_AD_IN_ICB;
inode->i_data.a_ops = &udf_adinicb_aops; inode->i_data.a_ops = &udf_adinicb_aops;
iinfo->i_lenAlloc = inode->i_size;
up_write(&iinfo->i_data_sem); up_write(&iinfo->i_data_sem);
} }
put_page(page); put_page(page);
......
...@@ -91,7 +91,7 @@ extern bool qid_valid(struct kqid qid); ...@@ -91,7 +91,7 @@ extern bool qid_valid(struct kqid qid);
* *
* When there is no mapping defined for the user-namespace, type, * When there is no mapping defined for the user-namespace, type,
* qid tuple an invalid kqid is returned. Callers are expected to * qid tuple an invalid kqid is returned. Callers are expected to
* test for and handle handle invalid kqids being returned. * test for and handle invalid kqids being returned.
* Invalid kqids may be tested for using qid_valid(). * Invalid kqids may be tested for using qid_valid().
*/ */
static inline struct kqid make_kqid(struct user_namespace *from, static inline struct kqid make_kqid(struct user_namespace *from,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment